Module do_list

The List Monad.

Behaviours: do_applicative, do_functor, do_monad.

Description

The List Monad.

Data Types

either()

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

fn()

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

fn()

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

map()

map(A) = #{term() := A}

maybe()

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

monad()

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

traversable()

traversable(A) = [A] | map(A)

Function Index

bind/2
do/2
fmap/2
is_instance/1
lift/1
liftA2/2
liftm/2
pure/1
sequence/1
then/2

Function Details

bind/2

bind(List::[A], F::fn(A, [B])) -> [B]

do/2

do(List::[A], Fs::[fn(A, [B]) | fn([B])]) -> [B]

fmap/2

fmap(F::fn(A, B), List::[A]) -> [B]

is_instance/1

is_instance(Term::term()) -> boolean()

lift/1

lift(F::fn(A, B)) -> fn(monad(A), monad(B))

liftA2/2

liftA2(List1::[fn(A, B)], List2::[A]) -> [B]

liftm/2

liftm(F::function(), Lists::[list()] | [fn(list())]) -> list()

pure/1

pure(A) -> [A]

sequence/1

sequence(Lists::traversable([A])) -> [traversable(A)]

then/2

then(List::list(), F::fn([A])) -> [A]


Generated by EDoc