
19 Jul
2011
19 Jul
'11
12:44 a.m.
Hi list! When I define an algebraic datatype without an instance for Eq, I'm obviously unable to use the (==) function on it. I can pattern-match with a series of function definitions (f [] = False; f x = True) on the expression, though. Why is that? I understand that in the second case I'm not literally using the (==) function, but it seems like there would be instances where you'd intentionally not want to be able to test for equality, and pattern-matching with multiple function definitions circumvents that. Thanks for your time, Tom