linsyking / elm-monad / Monad.Maybe

Maybe Monad

Computations which may return Nothing

Binding strategy: Nothing values bypass the bound function, other values are used as inputs to the bound function.

Useful for: Building computations from sequences of functions that may return Nothing.

return : a -> Maybe a

return function for Maybe

bind : Maybe a -> (a -> Maybe b) -> Maybe b

bind function for Maybe

fail : a -> Maybe a

fail function for Maybe