Monad.MONADThe abstract datatype of actions.
Instances of MONAD should satisfy the following laws for MONAD.(>>=):
(return a >>= h) = (h a),(m >>= return) = m,((m >>= g) >>= h) = (m >>= (fun x -> g x >>= h)).Using the Kleisli-composition operator MONAD.(>=>):
(return >=> h) = h,(f >=> return) = f,((f >=> g) >=> h) = (f >=> (g >=> h)).val return : 'a -> 'a treturn a injects a into the monadic type.
bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.
compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.
( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.