Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  wierd quickcheck outcome (Roelof Wobben)


----------------------------------------------------------------------

Message: 1
Date: Thu, 10 Sep 2015 14:12:44 +0200
From: Roelof Wobben <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] wierd quickcheck outcome
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed

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



------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 87, Issue 4
****************************************

Reply via email to