[Haskell-cafe] FGL instance constraint

Jason Dagit dagit at codersbase.com
Sat May 1 03:35:27 EDT 2010


On Sat, May 1, 2010 at 12:23 AM, Ivan Lazar Miljenovic <
ivan.miljenovic at gmail.com> wrote:

> Hmmm.... this is an interesting way of doing it, but I would argue that
> it's pointless: the fact that you're using MPTCs doesn't give you
> anything extra that the original class.  Furthermore, as I said earlier,
> it doesn't make sense to constrain the label type just to make an
> instance of a type class.
>
> (Now, if we had other functions in there which _might_ depend on the
> label types, this _would_ make sense; as it stands however, it doesn't.)
>

Try removing "Cls a" from the instance.  You'll notice that my empty does
depend on a having a Cls instance because it will fail to compile.  In other
words, I don't understand what you're talking about.  I did need the
constraint to define my instance.

And if that example gets boring, try making an instance of Set for Monad.
 Then re-read the article I linked from Oleg's website.  I'm not
understanding your point, and I suspect you're not understanding mine :)

Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100501/fd50e98c/attachment.html


More information about the Haskell-Cafe mailing list