ATSLIB/libats/ML/monad_list

This package gives an implementation of list-monad in ML-style.
  • monad
  • monad_type
  • monad_bind
  • monad_bind2
  • monad_bind3
  • monad_return
  • monad_unit
  • monad_nil
  • monad_cons
  • monad_seq
  • monad_join
  • monad_fmap
  • monad_liftm
  • monad_liftm2
  • monad_liftm3
  • monad_mapm
  • monad_mapm_
  • monad_seqlist
  • monad_seqlist_
  • monad_list_list
  • monad_list_listize
  • fprint_monad

  • monad

    Synopsis

    typedef
    monad(a:t@ype) = monad_type(a)

    monad_type

    Synopsis

    abstype
    monad_type(a:t@ype+) = ptr

    monad_bind

    Synopsis

    fun
    {a:t0p}
    {b:t0p}
    monad_bind
    (
      monad(a), cfun(a, monad(b))
    ) : monad(b) // end-of-function

    monad_bind2

    Synopsis

    fun
    {a1
    ,a2:t0p
    }{b:t0p}
    monad_bind2
    (
      monad(a1), monad(a2), cfun(a1, a2, monad(b))
    ) : monad(b) // end-of-function

    monad_bind3

    Synopsis

    fun
    {a1
    ,a2
    ,a3:t0p
    }{b:t0p}
    monad_bind3
    (
      monad(a1), monad(a2), monad(a3), cfun(a1, a2, a3, monad(b))
    ) : monad(b) // end-of-function

    monad_return

    Synopsis

    fun{a:t0p}
    monad_return(x: a): monad(a)

    monad_unit

    Synopsis

    fun{} monad_unit(): monad(unit)

    monad_nil

    Synopsis

    fun
    {a:t0p}
    monad_nil(): monad(list0(a))

    monad_cons

    Synopsis

    fun
    {a:t0p}
    monad_cons
    (
      monad(INV(a)), monad(list0(a))
    ) : monad(list0(a)) // end-of-fun

    monad_seq

    Synopsis

    fun{
    a1,a2:t0p
    } monad_seq
    (
      m1: monad(INV(a1)), m2: monad(INV(a2))
    ): monad(a2) // end of [monad_seq]

    monad_join

    Synopsis

    fun{a:t0p}
    monad_join(monad(monad(INV(a)))): monad(a)

    monad_fmap

    Synopsis

    fun
    {a:t0p}
    {b:t0p}
    monad_fmap(cfun(a, b), monad(a)): monad(b)

    monad_liftm

    Synopsis

    fun
    {a:t0p}
    {b:t0p}
    monad_liftm (cfun(a, b), monad(a)): monad(b)

    monad_liftm2

    Synopsis

    fun
    {a1
    ,a2:t0p
    }{b:t0p}
    monad_liftm2
      (cfun(a1, a2, b), monad(a1), monad(a2)): monad(b)

    monad_liftm3

    Synopsis

    fun
    {a1
    ,a2
    ,a3:t0p
    }{b:t0p}
    monad_liftm3
      (cfun(a1, a2, a3, b), monad(a1), monad(a2), monad(a3)): monad(b)

    monad_mapm

    Synopsis

    fun
    {a:t0p}
    {b:t0p}
    monad_mapm
      (cfun(a, b), list0(monad(a))): monad(list0(b))

    monad_mapm_

    Synopsis

    fun
    {a:t0p}
    {b:t0p}
    monad_mapm_(cfun(a, monad(b)), list0(a)): monad(unit)

    monad_seqlist

    Synopsis

    fun{a:t0p}
    monad_seqlist
      (list0(monad(INV(a)))): monad(list0(a))

    monad_seqlist_

    Synopsis

    fun{a:t0p}
    monad_seqlist_(list0(monad(INV(a)))): monad(unit)

    monad_list_list

    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.

    monad_list_listize

    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.

    fprint_monad

    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.
    This page is created with ATS by Hongwei Xi and also maintained by Hongwei Xi. SourceForge.net Logo