
Hi Can you think of a fourth way of redefining disjunct using pattern matching? vee :: Bool -> Bool -> Bool vee _ True = True vee True _ = True vee _ _ = False ve :: Bool -> Bool -> Bool ve True True = True ve True False = True ve False True = True ve False False = False v :: Bool -> Bool -> Bool v True b = True v b True = True v b False = b v False b = b Thanks Paul

[mailto:haskell-cafe-bounces@haskell.org] On Behalf Of PR Stanley
Hi Can you think of a fourth way of redefining disjunct using pattern matching? vee :: Bool -> Bool -> Bool vee _ True = True vee True _ = True vee _ _ = False
How many ways do you want? I think this is correct, and is only strict in the first arg: v :: Bool -> Bool -> Bool v True _ = True v False b = b Alistair ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. *****************************************************************

On Wed, Jun 13, 2007 at 02:37:37PM +0100, PR Stanley wrote:
Hi Can you think of a fourth way of redefining disjunct using pattern matching? vee :: Bool -> Bool -> Bool vee _ True = True vee True _ = True vee _ _ = False
ve :: Bool -> Bool -> Bool ve True True = True ve True False = True ve False True = True ve False False = False
v :: Bool -> Bool -> Bool v True b = True v b True = True v b False = b v False b = b
Most obvious is v :: Bool->Bool->Bool v False False = False v _ _ = True
participants (4)
-
Bayley, Alistair
-
Chris Mears
-
Ilya Tsindlekht
-
PR Stanley