Re: Case expressions, matching, and constants

2003-07-18 Thread Remi Turk
On Thu, Jul 17, 2003 at 12:03:19PM +0100, Bayley, Alistair wrote: This is what I've turned it into to get it to work. It seems a bit clumsy; is there a better way to write this? test n = case True of _ | n == one - one | n == two - two |

Re: Case expressions, matching, and constants

2003-07-17 Thread Graham Klyne
At 12:03 17/07/03 +0100, Bayley, Alistair wrote: This is what I've turned it into to get it to work. It seems a bit clumsy; is there a better way to write this? test n = case True of _ | n == one - one | n == two - two | otherwise - three

Re: Case expressions, matching, and constants

2003-07-17 Thread Hamilton Richards
At 12:03 PM +0100 7/17/03, Bayley, Alistair wrote: I've just debugged a program that used a case expression, but where I was trying to match on constants rather than literals. Here's a contrived example: module Main where one = 1 two = 2 test n = case n of one - one

RE: Case expressions, matching, and constants

2003-07-17 Thread Mark P Jones
Hi Alistair, | I've just debugged a program that used a case expression, but | where I was trying to match on constants rather than literals. | Here's a contrived example: | | module Main where | one = 1 | two = 2 | | test n = | case n of | one - one | two -