[Haskell-cafe] Improving MTL instances

Antoine Latter aslatter at gmail.com
Wed Oct 15 21:08:22 EDT 2008


On Wed, Oct 15, 2008 at 5:55 PM, wren ng thornton <wren at freegeek.org> wrote:
>
> Doing it that way removes the polymorphism that MonadState, MonadReader, etc
> offer to clients. For example, the backwards-state monad[1] is a MonadState
> but not a StateT (without extra plumbing). There are other examples which
> don't even change the semantics. It seems a shame to force these
> implementations to give different names for "the same" functions. Are MPTCs
> onerous? They'll be in haskell-prime afterall. Of course, the fundeps are
> another matter entirely...
>


Slightly off topic - if you do make your backwards-state monad an
instance on MonadState be careful not to use
Control.Monad.State.Class.modify - executing this falls into a black
hole for the backwards-state monad.

-Antoine


More information about the Haskell-Cafe mailing list