-- define a class with a type synonym, and a set of operations
class A a where
type B b
foo :: a -> B b
instance A Int where
type B = Bool
foo = (==0)
-- define two classes, and an function that .
class A a, B b where
foo :: a -> b
instance A Int, B Bool where
foo = (==0)
Also, has anybody written a paper on the differences between typeclasses + associated types and ML's module system + overloading?
Thanks,
Brian
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe