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 <alderzdev@gmail.com> wrote:
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