HaRP

Table of contents:

What is HaRP?

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.

History

Download

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).

Usage

  • Build the packages harp and haskell-src-exts and the preprocessor trhsx.
  • Use the preprocessor on files containing regular patterns. There are basically two ways to use it:
  • Documentation

    This 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]

    ToDo

    Contact us

    Copyright Announcement

    Please read this copyright note.