* Malcolm Wallace <malcolm.wall...@me.com> [2013-04-09 15:34:01+0100]
> 
> 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

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to