[Haskell-cafe] Problems with nested Monads
wren ng thornton
wren at freegeek.org
Sat Jul 11 00:26:32 EDT 2009
Job Vranish wrote:
> Yeah, I think the problem with my case is that while M is a specific monad
> (essentially StateT), N can be an arbitrary monad, which I think destroys my
> changes of making a valid joinInner/joinOuter/distribute.
> Maybe someday Haskell will infer valid joinInner/joinOuter for simple cases
> :D
Another alternative is to define a typeclass DistributesOverM, and
provide instances for the particular monads, n, you care about. Just
because you can't do it in general doesn't mean you can't do it :)
--
Live well,
~wren
More information about the Haskell-Cafe
mailing list