[Haskell-cafe] Missing join and split

Martin Sulzmann sulzmann at comp.nus.edu.sg
Tue Jan 1 21:49:53 EST 2008


Josef Svenningsson writes:
 > 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.
 > 

Also of interest might be XHaskell
http://taichi.ddns.comp.nus.edu.sg/taichiwiki/XhaskellHomePage
which adds XDuce style regular expression pattern matching to Haskell.

Martin


More information about the Haskell-Cafe mailing list