Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


yield(a: x): list(x) = &cons({head: a, tail: &empty_list()})

append(as: list(x), bs: list(x)) =
< empty_list() -> bs
, cons({head: c, tail: cs}) -> cons({head: c, tail: append(cs, bs)})
>(as)

flatten(ass: list(list(x)): list(x) =
< empty_list() -> empty_list()
| cons({head: bs, tail: bss}) -> append(bs, join(bss))
> ass

flat_map(f: x -> list(y), as: list(x)) = flatten(map(f, as))

A traversable will mean a functor also with a 'traverse' and 'sequence' function
...

************
Relevant papers:
https://tech.labs.oliverwyman.com/downloads/ex_nihilo_logic.pdf
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.3.9964&rep=rep1&type=ps