module type FREE_MONAD =sig
..end
F
.
For instance, Lisp-like nested lists can be built and dealt with like this:
module Lisp = CCCat.FreeMonad(CCList);;
let l = Lisp.(inj [1;2;3] >>= fun x -> inj [x; x*2; x+100]);;
module F:CCCat.FUNCTOR
type 'a
t =
| |
Return of |
| |
Roll of |
include CCCat.MONAD
val inj : 'a F.t -> 'a t