Jason Dagit <da...@codersbase.com> writes:

> On Fri, Apr 30, 2010 at 11:30 PM, Jason Dagit <da...@codersbase.com> wrote:
> Looking over this real quick, I think the Graph class should be changed to
> mention a and b:
>
> class Graph (gr a b)  where ...

Won't work: you need to specify that gr has kind * -> * -> *; this is
exactly the same as how Functor, Monad, etc. are defined.

>
> Then your instances would be able to mention constraints:
>
> instance Cls a => Graph (GrB a b) where ...
>
> Why wasn't the Graph class designed this way?  My guess:  It was probably a
> decision that predated multiparameter type classes.

That's not an MPTC (it would be more like "class Graph gr a b" if it
was) and doesn't matter in this case anyway.

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to