[Haskell-cafe] Why can't we make an instance declaration on a type synonym?

Daniel Fischer daniel.is.fischer at web.de
Sun Jan 3 00:18:34 EST 2010


Am Sonntag 03 Januar 2010 05:37:31 schrieb Jason Dusek:
>   Well, you can, with:
>
>     -XTypeSynonymInstances
>
>   though I'm not sure it addresses your specific need.

Doesn't help him here, he would need

instance Monad (State s) where ...

but that would be a partially applied type synonym. He would also need type level lambdas,

type State s = /\ a -> (s -> (a,s))

But type level lambdas and partially applied type synonyms make type inference undecidable 
if I remember correctly (if it wasn't that, they'd have other dire consequences).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100102/28ce28c8/attachment.html


More information about the Haskell-Cafe mailing list