G'day all.

Quoting Isaac Dupree <[EMAIL PROTECTED]>:

I know!  I said so!  My question is whether anyone has an example of
doing either of those in mutually-recursive DEFAULT METHOD definitions?

class (Eq a) => StupidEqList a where
    eqList :: [a] -> [a] -> Bool
    neqList :: [a] -> [a] -> Bool

    eqList [] [] = True
    eqList (x:xs) (y:ys) = x == y && not (neqList xs ys)
    eqList _ _ = False

    neqList [] [] = False
    neqList (x:xs) (y:ys) = x /= y || not (eqList xs ys)
    neqList _ _ = True

Stupid, but not illegal.

Cheers,
Andrew Bromage
_______________________________________________
Haskell mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to