
1 Jan
2008
1 Jan
'08
5:29 p.m.
On Dec 28, 2007 11:40 PM, Mitar
Would not it be interesting and useful (but not really efficient) to have patterns something like:
foo :: Eq a => a -> ... foo (_{4}'b') = ...
which would match a list with four elements ending with an element 'b'. Or:
foo (_+';'_+';'_) = ...
which would match a list with embedded two ';' elements. (Last _ matched the remaining of the list.)
I suggest you take at look at HaRP, Haskell Regular Patterns: http://www.cs.chalmers.se/~d00nibro/harp/ It hasn't been updated for a while but it should still be useable. Cheers, Josef