29 Dec
2007
29 Dec
'07
3:51 a.m.
G'day all. Quoting Isaac Dupree <isaacdupree@charter.net>:
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