[Haskell-beginners] Using symbolic values in the case expression

C K Kashyap ckkashyap at gmail.com
Thu Nov 11 12:03:10 EST 2010


Hi,
I'd like to do something like this -

Instead of doing this -

f x = case x of
   1 -> "One"
   2 -> "Two"

I'd like to do this -

v1 = 1
v2 = 2

f x = case of
  v1 -> "One"
  v2 -> "Two"


Is that possible?


-- 
Regards,
Kashyap


More information about the Beginners mailing list