Module do

The Do Module.

Description

The Do Module.

Data Types

either()

either(A, B) = {error, A} | {ok, B}

fn()

fn(A, B) = fun((A) -> B)

fn()

fn(A) = fun(() -> A)

maybe()

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

monad()

monad(A) = [A] | either(term(), A) | maybe(A)

Function Index

bind/2
do/2
get_monads/0
pure/1
register_monad/1
then/2

Function Details

bind/2

bind(F::fn(A, monad(B)), Monad::monad(A)) -> monad(B)

do/2

do(Monad::monad(A), Funs::[fn(A, monad(B)) | fn(monad(B))]) -> monad(B)

get_monads/0

get_monads() -> [atom()]

pure/1

pure(A) -> monad(A) | A

register_monad/1

register_monad(Mod::atom()) -> either(duplicate_monad, ok)

then/2

then(F::fn(monad(B)), Monad::monad(term())) -> monad(B)


Generated by EDoc