[Haskell-cafe] M1 + M2 = M3 where both computations in M1 and M2
can be used?
kenn at kenn.frap.net
Mon May 12 14:33:20 EDT 2008
On Mon, May 12, 2008 at 6:51 AM, sam lee <skynare at gmail.com> wrote:
> I want to compose two monads to build another monad where
> computations of the two monads can be used inside.
Twan's suggestion seems like a natural way to continue with the
existing code you have described (based on monad transformers). If
you would like to understand this issue in some depth, I recommend the
following paper which presents a general way to combine two monads
that is not biased towards having one "contained" in the other.
- Composing monads using coproducts. C L=FCth, N Ghani. ICFP 2002.
I just tried it out the other day, so if you'll excuse the
self-promotion here is a demonstration
More information about the Haskell-Cafe