22 Oct
2004
22 Oct
'04
4:26 p.m.
On 2004 October 22 Friday 12:15, Ben Rudiak-Gould wrote:
Ryan Newton wrote:
[...] case 3 of 3 -> 99; 4 -> 99
You can do this:
let rhs = (some complicated expression) in case 3 of 3 -> rhs 4 -> rhs
You can also do case 3 of x | x `elem` [3,4] -> 99 though strictly speaking that's not using pattern matching to get the job done. Haskell syntax doesn't provide a way to associate multiple patterns with one right hand side.