
17 Jul
2009
17 Jul
'09
2:38 p.m.
Christopher,
Wouldn't it be great if pattern variables could be used more than once in a pattern? Like so:
foo [x,x,_,x] = "The values are the same!" foo _ = "They're not the same!"
These are called nonlinear patterns. I think Miranda (a precursor of Haskell, sort of) used to have them. Cheers, Stefan