
1 May
2010
1 May
'10
2:56 a.m.
Jason Dagit
On Fri, Apr 30, 2010 at 11:30 PM, Jason Dagit
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.Miljenovic@gmail.com IvanMiljenovic.wordpress.com