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)

maybe()

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

monad()

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

traversable()

traversable(A) = [A] | #{term() := A}

Function Index

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

Function Details

bind/2

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

do/2

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

fmap/2

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

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::[[term()]] | [fn([term()])]) -> [term()]

pure/1

pure(A) -> [A]

sequence/1

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

then/2

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


Generated by EDoc