
6 Mar
2009
6 Mar
'09
4:12 a.m.
Gleb Alexeyev wrote:
instance Eq a => Eq (CatList a) where a == b = case (viewCL a, viewCL b) of (Just (x, xs), Just (y, ys)) -> x==y && xs == ys (Nothing, Nothing) -> True _ -> False I just realized that my solution is needlessly verbose, the following instance suffices: instance Eq a => Eq (CatList a) where a == b = viewCL a == viewCL b