monads

A missing monad library
IN THIS PACKAGE
Module Monads . Std . Monad . Option . Make2 . M . Syntax
val (>>=) : ( 'a, 'e ) t -> ( 'a -> ( 'b, 'e ) t ) -> ( 'b, 'e ) t

m >>= f is bind m f

val (>>|) : ( 'a, 'e ) t -> ( 'a -> 'b ) -> ( 'b, 'e ) t

m >>= f is map m ~f

val (>=>) : ( 'a -> ( 'b, 'e ) t ) -> ( 'b -> ( 'c, 'e ) t ) -> 'a -> ( 'c, 'e ) t

f >=> g is fun x -> f x >>= g

val (!!) : 'a -> ( 'a, 'e ) t

!!x is return x

val (!$) : ( 'a -> 'b ) -> ( 'a, 'e ) t -> ( 'b, 'e ) t

!$f is Lift.unary f

val (!$$) : ( 'a -> 'b -> 'c ) -> ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'c, 'e ) t

!$$f is Lift.binary f

val (!$$$) : ( 'a -> 'b -> 'c -> 'd ) -> ( 'a, 'e ) t -> ( 'b, 'e ) t -> ( 'c, 'e ) t -> ( 'd, 'e ) t

!$$$f is Lift.ternary f

val (!$$$$) : ( 'a -> 'b -> 'c -> 'd -> 'e ) -> ( 'a, 's ) t -> ( 'b, 's ) t -> ( 'c, 's ) t -> ( 'd, 's ) t -> ( 'e, 's ) t

!$$$$f is Lift.quaternary f

val (!$$$$$) : ( 'a -> 'b -> 'c -> 'd -> 'e -> 'f ) -> ( 'a, 's ) t -> ( 'b, 's ) t -> ( 'c, 's ) t -> ( 'd, 's ) t -> ( 'e, 's ) t -> ( 'f, 's ) t

!$$$$$f is Lift.quinary f