
1 Nov
2010
1 Nov
'10
12:25 p.m.
No, not if you use case. But you can do better with a simple if, in this
particular case.
if n == 3 || n == 4
then "Something"
else "Other"
Or even,
if n `elem` [3,4]
them "Something"
else "Other"
HTH,
On 1 November 2010 15:59, Angel Alonso
Hi,
I have the following piece of code:
n = 3 case n of 3 -> "Something" 4 -> "Something" _ -> "Other"
Is it possible to shorten the case statement into something like this?:
n = 3 case n of 3 or 4 -> "Something" _ -> "Other"
Thanks.
-- Angel Alonso _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- Ozgur Akgun