ATSLIB/libats/ML/monad_list
This package gives an implementation of list-monad in ML-style.
Synopsis
typedef
monad(a:t@ype) = monad_type(a)
Synopsis
abstype
monad_type(a:t@ype+) = ptr
Synopsis
fun
{a:t0p}
{b:t0p}
monad_bind
(
monad(a), cfun(a, monad(b))
) : monad(b)
Synopsis
fun
{a1
,a2:t0p
}{b:t0p}
monad_bind2
(
monad(a1), monad(a2), cfun(a1, a2, monad(b))
) : monad(b)
Synopsis
fun
{a1
,a2
,a3:t0p
}{b:t0p}
monad_bind3
(
monad(a1), monad(a2), monad(a3), cfun(a1, a2, a3, monad(b))
) : monad(b)
Synopsis
fun{a:t0p}
monad_return(x: a): monad(a)
Synopsis
fun{} monad_unit(): monad(unit)
Synopsis
fun
{a:t0p}
monad_nil(): monad(list0(a))
Synopsis
fun
{a:t0p}
monad_cons
(
monad(INV(a)), monad(list0(a))
) : monad(list0(a))
Synopsis
fun{
a1,a2:t0p
} monad_seq
(
m1: monad(INV(a1)), m2: monad(INV(a2))
): monad(a2)
Synopsis
fun{a:t0p}
monad_join(monad(monad(INV(a)))): monad(a)
Synopsis
fun
{a:t0p}
{b:t0p}
monad_fmap(cfun(a, b), monad(a)): monad(b)
Synopsis
fun
{a:t0p}
{b:t0p}
monad_liftm (cfun(a, b), monad(a)): monad(b)
Synopsis
fun
{a1
,a2:t0p
}{b:t0p}
monad_liftm2
(cfun(a1, a2, b), monad(a1), monad(a2)): monad(b)
Synopsis
fun
{a1
,a2
,a3:t0p
}{b:t0p}
monad_liftm3
(cfun(a1, a2, a3, b), monad(a1), monad(a2), monad(a3)): monad(b)
Synopsis
fun
{a:t0p}
{b:t0p}
monad_mapm
(cfun(a, b), list0(monad(a))): monad(list0(b))
Synopsis
fun
{a:t0p}
{b:t0p}
monad_mapm_(cfun(a, monad(b)), list0(a)): monad(unit)
Synopsis
fun{a:t0p}
monad_seqlist
(list0(monad(INV(a)))): monad(list0(a))
Synopsis
fun{a:t0p}
monad_seqlist_(list0(monad(INV(a)))): monad(unit)
Synopsis
fun{a:t0p}
monad_list_list(xs: list0(INV(a))): monad(a)
Description
This function, which is just an identity, turns a list into a list-monad.
Synopsis
fun{a:t0p}
monad_list_listize(m: monad(INV(a))): list0(a)
Description
This function, which is just an identity, turns a list-monad into a list.
Synopsis
fun{a:t0p}
fprint_monad(out: FILEref, m: monad(INV(a))): void
Description
This function prints out a list-monad onto a given channel.