Printer Friendly
Dictionary, Encyclopedia and Thesaurus - The Free Dictionary
1,760,594,542 visitors served.
forum mailing list For webmasters
?
New: Language forums
Dictionary/
thesaurus
Medical
dictionary
Legal
dictionary
Financial
dictionary
Acronyms
 
Idioms
Encyclopedia
Wikipedia
encyclopedia
?

monad
(redirected from Monads)

   Also found in: Dictionary/thesaurus, Medical, Legal, Wikipedia, Hutchinson 0.02 sec.
monad: see Bruno, Giordano Bruno, Giordano (jōrdä`nō br
..... Click the link for more information.
; Leibniz, Gottfried Wilhelm, Baron von Leibniz or Leibnitz, Gottfried Wilhelm, Baron von
..... Click the link for more information.
.
monad
1. Philosophy
a. any fundamental singular metaphysical entity, esp if autonomous
b. (in the metaphysics of Leibnitz) a simple indestructible nonspatial element regarded as the unit of which reality consists
c. (in the pantheistic philosophy of Giordano Bruno) a fundamental metaphysical unit that is spatially extended and psychically aware
2. a single-celled organism, esp a flagellate protozoan
3. an atom, ion, or radical with a valency of one

(theory, functional programming)monad - /mo'nad/ A technique from category theory which has been adopted as a way of dealing with state in functional programming languages in such a way that the details of the state are hidden or abstracted out of code that merely passes it on unchanged.

A monad has three components: a means of augmenting an existing type, a means of creating a default value of this new type from a value of the original type, and a replacement for the basic application operator for the old type that works with the new type.

The alternative to passing state via a monad is to add an extra argument and return value to many functions which have no interest in that state. Monads can encapsulate state, side effects, exception handling, global data, etc. in a purely lazily functional way.

A monad can be expressed as the triple, (M, unitM, bindM) where M is a function on types and (using Haskell notation):

unitM :: a -> M a bindM :: M a -> (a -> M b) -> M b

I.e. unitM converts an ordinary value of type a in to monadic form and bindM applies a function to a monadic value after de-monadising it. E.g. a state transformer monad:

type S a = State -> (a, State) unitS a = \ s0 -> (a, s0) m `bindS` k = \ s0 -> let (a,s1) = m s0 in k a s1

Here unitS adds some initial state to an ordinary value and bindS applies function k to a value m. (`fun` is Haskell notation for using a function as an infix operator). Both m and k take a state as input and return a new state as part of their output. The construction

m `bindS` k

composes these two state transformers into one while also passing the value of m to k.

Monads are a powerful tool in functional programming. If a program is written using a monad to pass around a variable (like the state in the example above) then it is easy to change what is passed around simply by changing the monad. Only the parts of the program which deal directly with the quantity concerned need be altered, parts which merely pass it on unchanged will stay the same.

In functional programming, unitM is often called initM or returnM and bindM is called thenM. A third function, mapM is frequently defined in terms of then and return. This applies a given function to a list of monadic values, threading some variable (e.g. state) through the applications:

mapM :: (a -> M b) -> [a] -> M [b] mapM f [] = returnM [] mapM f (x:xs) = f x `thenM` ( \ x2 -> mapM f xs `thenM` ( \ xs2 -> returnM (x2 : xs2) ))


How to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit webmaster's page for free fun content.
?Page tools
Printer friendly
Cite / link
Email
Feedback
? Mentioned in ? References in periodicals archive
 
Women tend to have more relational manners of thinking than do men, which is to say that we tend to view ourselves within a complex or tissue of relations and not as isolated monads, a view that is more likely to be had by male thinkers," says Michele Schumacher, a mother of four and editor of the book Women in Christ (Wm.
The final surprise I'll mention is that Leibniz's system of doing physics, which is based on fundamental units called monads, has got a few things in common with the modern notion of computational physics, or "it from bit.
Giordano Bruno's ensouled monads, Rene Descartes' (divisible) particles of res extensa, Pierre Gassendi's (indivisible) atoms with their hooks and eyes, and the chemical atoms and corpuscles that were proposed in the period between Daniel Sennert and Robert Boyle have very little in common with one another.
 
Encyclopedia browser? ? Full browser
 
 
Encyclopedia
?

Disclaimer | Privacy policy | Feedback | Copyright © 2009 Farlex, Inc.
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. Terms of Use.