Module s2_maybe

The Maybe Monad.

Description

The Maybe Monad.

Data Types

'maybe'()

'maybe'(A, B) = {ok, A} | {error, B}

Function Index

do/1doc(Fs) is the result of chaining Fs inside the maybe monad.
lift/1lift(F) is the value of F() lifted into the maybe monad.
lift/2
map/2map(F, Xs) is the result of mapping F over Xs inside the maybe monad.
reduce/2reduce(F, Xs) is the result of reducing Xs to F inside the maybe monad.
reduce/3
to_bool/1to_bool(X) is the boolean representation of the maybe-value X.
unlift/1unlift(F) is the result of F() extracted from the maybe monad.
unlift/2

Function Details

do/1

do(Fs::[function()]) -> 'maybe'(term(), term())

doc(Fs) is the result of chaining Fs inside the maybe monad.

lift/1

lift(F::function()) -> 'maybe'(term(), term())

lift(F) is the value of F() lifted into the maybe monad.

lift/2

lift(F, X) -> any()

map/2

map(F::function(), Xs::[term()]) -> 'maybe'(term(), term())

map(F, Xs) is the result of mapping F over Xs inside the maybe monad.

reduce/2

reduce(F::function(), Xs::[term()]) -> 'maybe'(term(), term())

reduce(F, Xs) is the result of reducing Xs to F inside the maybe monad.

reduce/3

reduce(F, Acc0, Xs) -> any()

to_bool/1

to_bool(X1::'maybe'(term(), term())) -> boolean()

to_bool(X) is the boolean representation of the maybe-value X.

unlift/1

unlift(F::function()) -> term()

unlift(F) is the result of F() extracted from the maybe monad.

unlift/2

unlift(F, X) -> any()


Generated by EDoc