[Haskell-cafe] A catch-all MonadIO instance
Bas van Dijk
v.dijk.bas at gmail.com
Fri Oct 28 16:51:47 CEST 2011
On 28 October 2011 16:23, Antoine Latter <aslatter at gmail.com> wrote:
> I would then need OverlappingInstances to declare a MonadIO instance
> for any similar looking instance head (that is `t m`) where 't' was
> not a proper MonadTrans instance, which sounds like a common enough
> things to do.
I actually have never seen a MonadIO instance for a `t m` where 't' is
not a MonadTrans instance.
On 28 October 2011 16:24, Paterson, Ross <R.Paterson at city.ac.uk> wrote:
> It's done that way in transformers to keep the package portable.
> As for doing it elsewhere, although this catch-all instance requires
> UndecidableInstances, I don't think it introduces non-termination.
I understand, portability is important for transformers. For
monad-control it's less of an issue because I already use other
language extensions (incl. RankNTypes).
So I think I go ahead and add a catch-all instance for MonadControlIO
Thanks for your responses,
More information about the Haskell-Cafe