HaRP, or Haskell Regular Patterns, is a Haskell extension that extends the normal pattern matching facility with the power of regular expressions. This expressive power is highly useful in a wide range of areas, including text parsing and XML processing. Regular expression patterns in HaRP work over ordinary Haskell lists ([]) of arbitrary type. We have implemented HaRP as a pre-processor to ordinary Haskell.
HaRP is distributed along with the haskell-src-exts package, which, incidentally, is needed in order to build the preprocessor.
$> darcs get http://www.cs.chalmers.se/~d00nibro/haskell-src-exts
The package should work on any platform where GHC works. The installation instructions assume a working cabal which means GHC-6.4. For older versions of GHC you'll have to build it yourself (not very difficult).
trhsx infile [outfile] ghc -F -pgmFtrhsx infileThis short tutorial should get you started.
There is also a short list of examples of uses of HaRP. If you have a nice, useful example that you would like to share, please contact us and we can put it up with the rest of them.
You can also read our article "Regular Expression Patterns", published in the proceedings of ICFP'04. [ps]
Please read this copyright note.