
30 Mar
2004
30 Mar
'04
3:52 a.m.
On Tue, 30 Mar 2004, Dylan Thurston wrote:
If you use multi-parameter type classes, then in your instance declaration you can specify exactly what requirements you need. For instance:
class VectorSpace v a where zero :: v add :: v -> v -> v scale :: a -> v -> v
Multi-parameter type classes aren't Haskell 98, are they? I tried to stay away from them. I didn't get the point yet why the context for 'data' is not sufficient for the 'instance' method definition.