
9 Apr
2013
9 Apr
'13
2:43 p.m.
* Malcolm Wallace
On 9 Apr 2013, at 14:46, Sturdy, Ian wrote:
As far as the use of Eq goes, Eq is already enshrined in pattern matching by pattern matching against literals.
Not true. Pattern-matching literals explicitly avoids any use of Eq. Demonstration:
data Foo = Foo | Bar instance Eq Foo where _ == _ = True
isFoo Foo = True isFoo Bar = False
main = do print (isFoo Bar) print (Foo==Bar)
I think he meant numeric literals. Roman