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.
_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to