[Haskell-cafe] Newtype deriving with functional dependencies

Daniel Gorín dgorin at dc.uba.ar
Sun Feb 1 22:59:11 EST 2009


On Feb 2, 2009, at 1:06 AM, Louis Wasserman wrote:

> Is there any sensible way to make
>
> newtype FooT m e = FooT (StateT Bar m e) deriving (MonadState)
>
> work to give instance MonadState Bar (FooT m e)?
>
> That is, I'm asking if there would be a semantically sensible way of  
> modifying GeneralizedNewtypeDeriving to handle multi-parameter type  
> classes when there is a functional dependency involved, assuming by  
> default that the newtype is the more general of the types, perhaps?
>
> Louis Wasserman
> wasserman.louis at gmail.com
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


did you try this?

newtype FooT m e = FooT (StateT Bar m e) deriving (Monad, MonadState  
Bar)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090202/f5d1a530/attachment.htm


More information about the Haskell-Cafe mailing list