[Haskell-cafe] Missing join and split

Josef Svenningsson josef.svenningsson at gmail.com
Tue Jan 1 17:29:54 EST 2008


On Dec 28, 2007 11:40 PM, Mitar <mmitar at gmail.com> wrote:
> 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


More information about the Haskell-Cafe mailing list