The Free monad
Free type is isomorphic to:
data Free f r = Pure r | Wrap (f (Free f r))
... except that if you want to pattern match against those constructors, you
must first use
runFree to unwrap the value first.
The FreeT monad transformer
A free monad transformer alternates nesting the base functor
f and the
f- The functor that generates the free monad
m- The base monad
r- The type of the return value
This type commonly arises in coroutine/iteratee libraries under various names.