[Haskell-cafe] M1 + M2 = M3 where both computations in M1 and M2 can be used?

2008-05-12 Thread sam lee
Hi. I want to compose two monads to build another monad where computations of the two monads can be used inside. I have: - MonadTypeInfer : interface (class) for TypeInfer monad - TypeInfer : a monad that has Map String Type (association of names and types) - TypeInferT : transformer of above

Re: [Haskell-cafe] M1 + M2 = M3 where both computations in M1 and M2 can be used?

2008-05-12 Thread Twan van Laarhoven
sam lee wrote: Hi. I want to compose two monads to build another monad where computations of the two monads can be used inside. I have: - MonadTypeInfer : interface (class) for TypeInfer monad - TypeInfer : a monad that has Map String Type (association of names and types) - TypeInferT :

Re: [Haskell-cafe] M1 + M2 = M3 where both computations in M1 and M2 can be used?

2008-05-12 Thread Kenn Knowles
On Mon, May 12, 2008 at 6:51 AM, sam lee [EMAIL PROTECTED] wrote: Hi. 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

Re: [Haskell-cafe] M1 + M2 = M3 where both computations in M1 and M2 can be used?

2008-05-12 Thread sam lee
tInfer :: MonadTypeInfer m = Expr - m Type eval :: MonadEval m = Expr - m Expr That solves! I should've left out type annotation. On Mon, May 12, 2008 at 10:38 AM, Twan van Laarhoven [EMAIL PROTECTED] wrote: sam lee wrote: Hi. I want to compose two monads to build another