
22 Aug
2003
22 Aug
'03
1 p.m.
Thanks. I was reading some codes in ML, and it was commented this was the case. I didn't know Haskell had the equivalent behavior. I always thought once the pattern was matched there is no going back.
I may be confused about what you're asking for, but Haskell does this by default:
foo (Left x) | x>3 = "bar" foo _ = "splat"
Main> foo (Left 5) "bar" Main> foo (Left 1) "splat"