Maths - Monad Types

On these pages we look at specific examples of monads, some from the world of programming:

Monads in Haskell

Haskell is a programming language that does not directly support the concept of a sequence of computations in strict order, Haskell tends to combine its computations only by function composition, in that sense there is a link between Haskell and category theory in that they both rely on function composition.

Haskell also does not directly support other computations that would require 'non-pure' functions such as state, input and output. However all computer languages need these things, a simple computer program might compute a sequence of statements like:

Read some input
do some computation on it
Output the result

Not being able to do these things, or not guaranteeing to do them in that order, would make the language useless for practical work.

There is a way we can guarantee order in a functional language, if we have a set of composed functions:

f3(f2(f1 x)))

then f1 must have computed its result before f2 and so on.

So haskell must take function composition and make it look like a sequence of statements, to do this it uses monads (in a slightly modified form).

Monads in Haskell are described more fully here.


metadata block
see also:

http://www.mathreference.com/

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

flag flag flag flag flag flag The Princeton Companion to Mathematics - This is a big book that attempts to give a wide overview of the whole of mathematics, inevitably there are many things missing, but it gives a good insight into the history, concepts, branches, theorems and wider perspective of mathematics. It is well written and, if you are interested in maths, this is the type of book where you can open a page at random and find something interesting to read. To some extent it can be used as a reference book, although it doesn't have tables of formula for trig functions and so on, but where it is most useful is when you want to read about various topics to find out which topics are interesting and relevant to you.

 

Terminology and Notation

Specific to this page here:

 

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2017 Martin John Baker - All rights reserved - privacy policy.