Monad



[mon-ad, moh-nad] /ˈmɒn æd, ˈmoʊ næd/

noun
1.
Biology.

2.
Chemistry. an element, atom, or group having a valence of one.
Compare (def 3), (def 2a).
3.
Philosophy.

4.
a single unit or entity.
/ˈmɒnæd; ˈməʊ-/
noun
1.
(philosophy) (pl) -ads, -ades (-əˌdiːz)

2.
a single-celled organism, esp a flagellate protozoan
3.
an atom, ion, or radical with a valency of one
n.

“unity, arithmetical unit,” 1610s, from Late Latin monas (genitive monadis), from Greek monas “unit,” from monos “alone” (see mono-). In Leibnitz’s philosophy, “an ultimate unit of being” (1748). Related: Monadic.

monad mo·nad (mō’nād’)
n.

mo·nad’ic (mə-nād’ik) or mo·nad’i·cal adj.
theory, functional programming
/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) ))
(2000-03-09)

Tagged:

Read Also:

  • Monaco

    [mon-uh-koh, muh-nah-koh; French maw-na-kaw; Italian maw-nah-kaw] /ˈmɒn əˌkoʊ, məˈnɑ koʊ; French mɔ naˈkɔ; Italian ˈmɔ nɑˌkɔ/ noun 1. a principality on the Mediterranean coast, bordering SE France. ½ sq. mi. (1.3 sq. km). 2. the capital of this principality. /ˈmɒnəˌkəʊ; məˈnɑːkəʊ; French mɔnako/ noun 1. a principality in SW Europe, on the Mediterranean and forming […]

  • Monadal

    [mon-ad, moh-nad] /ˈmɒn æd, ˈmoʊ næd/ noun 1. Biology. 2. Chemistry. an element, atom, or group having a valence of one. Compare (def 3), (def 2a). 3. Philosophy. 4. a single unit or entity. /ˈmɒnæd; ˈməʊ-/ noun 1. (philosophy) (pl) -ads, -ades (-əˌdiːz) 2. a single-celled organism, esp a flagellate protozoan 3. an atom, ion, […]



  • Monadelphous

    [mon-uh-del-fuh s] /ˌmɒn əˈdɛl fəs/ adjective, Botany. 1. (of stamens) united into one bundle or set by their filaments. 2. (of a plant or flower) having the stamens so united. /ˌmɒnəˈdɛlfəs/ adjective 1. (of stamens) having united filaments forming a tube around the style 2. (of flowers) having monadelphous stamens monadelphous (mŏn’ə-děl’fəs, mō’nə-) Related to […]

  • Monades

    [mon-uh-deez] /ˈmɒn əˌdiz/ noun 1. plural of . [mon-as, moh-nas] /ˈmɒn æs, ˈmoʊ næs/ noun, plural monades [mon-uh-deez] /ˈmɒn əˌdiz/ (Show IPA) 1. . /ˈmɒnæs; ˈməʊ-/ noun (pl) monades (ˈmɒnəˌdiːz) 1. another word for monad (sense 1), monad (sense 2)



Disclaimer: Monad definition / meaning 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. All content on this website is for informational purposes only.