
10 Sep
2015
10 Sep
'15
12:12 p.m.
Op 10-9-2015 om 09:54 schreef Frerich Raabe:
On 2015-09-10 09:23, Roelof Wobben wrote:
which I wants to test with this function :
prop_fourDifferent :: Integer -> Integer -> Integer -> Integer -> Bool prop_fourDifferent a b c d = fourDifferent a b c d == ( a == b ) && ( a == c ) && (a == d)
The problem is that (==) has a higher precedence (4) than (&&) (which has precedence 3). So your definition is equivalent to
prop_fourDifferent a b c d = (fourDifferent a b c d == ( a == b )) && ( a == c ) && (a == d)
You need some extra parentheses there, try
prop_fourDifferent a b c d = fourDifferent a b c d == (( a == b ) && ( a == c ) && (a == d))
Thanks, Learned that in this sort of situations I have to check the precendence. Roelof