[Haskell-cafe] FGL instance constraint

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Sat May 1 02:53:58 EDT 2010


Jason Dagit <dagit at codersbase.com> writes:

> On Fri, Apr 30, 2010 at 11:08 PM, Ivan Lazar Miljenovic <
> ivan.miljenovic at gmail.com> wrote:
>>
>>
>> You're putting the constraint in the wrong places: put the "(Cls a) => "
>> in the actual functions where you need it.
>>
>
> That's solid advice in general, but it's still not going to work here if any
> of the functions needed for the instance of Graph require the type class
> constraint.

The Graph class doesn't care what the labels are, so it should matter
about the constraint.

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list