[Haskell-cafe] ANNOUNCE: monad-control-0.3
Joey Hess
joey at kitenet.net
Tue Dec 6 04:03:16 CET 2011
I'm trying to convert from 0.2 to 0.3, but in way over my head.
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
newtype Annex a = Annex { runAnnex :: StateT AnnexState IO a }
deriving (
Monad,
MonadIO,
-- MonadControlIO
MonadBaseControl IO
)
I added that after seeing this when I changed some code to use
the new liftBaseOp instead of liftIOOp. (They're equivilant, right?)
No instance for (MonadBaseControl IO Annex)
arising from a use of `liftBaseOp'
But with ghc 7.0.4, the derivation fails:
Annex.hs:45:17:
Can't make a derived instance of `MonadBaseControl IO Annex'
(even with cunning newtype deriving):
the class has associated types
In the newtype declaration for `Annex'
The only way I can find to make my code compile is to lose the newtype.
But of course that makes for some ugly type messages.
--
see shy jo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111205/47a5af73/attachment-0001.pgp>
More information about the Haskell-Cafe
mailing list