Module type Monad.S


module type S = sig .. end
Signature for monads

type 'a t 
The type of a monad producing values of type 'a.
val bind : 'a t -> ('a -> 'b t) -> 'b t
Monadic binding.

bind m f executes first m then f, using the result of m.

val return : 'a -> 'a t
Return a value.
val failwith : string -> 'a t
Report a fatal error and leave the monadic world.

failwith msg leaves the monadic world as a consequence of a programming accident, such as a pattern match error. This function should not be used for exceptions, only for fatal errors.