In article <[EMAIL PROTECTED]>, Graham Klyne <[EMAIL PROTECTED]> wrote:
> class (Eq k, Show k) => Pair a k v where > newPair :: (k,v) -> a k v > getPair :: a k v -> (k,v) I would consider one of these instead: class Pair1 a where newPair1 :: (Eq k, Show k) => (k,v) -> a k v getPair1 :: (Eq k, Show k) => a k v -> (k,v) class (Eq k, Show k) => Pair2 p k v | p -> k,v where newPair2 :: (k,v) -> p getPair2 :: p -> (k,v) Pair2 is more general than Pair, for instance: data CharBoolPair = MkCharBoolPair Char Bool instance Pair2 CharBoolPair Char Bool where newPair2 (c,b) = MkCharBoolPair c b getPair2 (MkCharBoolPair c b) = (c,b) CharBoolPair cannot be made an instance of your Pair (since it has kind "*"). Pair is more general than my Pair1, there may be type constructors that are instances of Pair but not Pair1; but I can't imagine them turning up in well-written code. -- Ashley Yakeley, Seattle WA _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell