16 Oct
2007
16 Oct
'07
9:50 p.m.
Dear Haskellers, why this program is not accepted by Hugs? equal a a = True equal a b | not(a==b) = False Best, Manher
16 Oct
16 Oct
9:52 p.m.
hg.manuel:
Dear Haskellers,
why this program is not accepted by Hugs?
equal a a = True equal a b | not(a==b) = False
You can't pattern match 'a' and 'a' like that -- there's no implicit unification. Instead, I'd write: equal a b | a == b = True | otherwise = False Well actually, maybe I'd write: equal a b = a == b In reality, though: equal = (==) And then I'd just use (==) directly :) Cheers, Don
6891
Age (days ago)
6891
Last active (days ago)
1 comments
2 participants
participants (2)
-
Don Stewart -
Manuel Hernandez