
11 Nov
2010
11 Nov
'10
1:42 p.m.
On 11 November 2010 17:03, C K Kashyap
v1 = 1 v2 = 2
f x = case x of v1 -> "One" v2 -> "Two"
The closest I can thin is the following: f x | x == v1 = "One" | x == v2 = "Two" But, keep in mind, this is *not* the same thing. It requires Eq on x, and you lose all the exhaustiveness/overlapping checks pattern matching provides. HTH, -- Ozgur Akgun