Haskell ATerm Library (1.4)ContentsIndex
Haskell ATerm Library (1.4)

ATerms

The ATerms provide a generic format for representation and exchange of (annotated) terms.

ATerms were developed in the context of the ASF+SDF Meta-Environment. They are also used by the rewriting language Stratego, by the transformation tool bundle XT, by the visitor generator JJForester, and by numerous other tools developed at CWI, Universiteit Utrecht, and elsewhere.

The ATerm Library (http://www.cwi.nl/projects/MetaEnv/aterm/) provides implementations of the ATerm Library in C and Java, including numerous ATerm command line utilities implemented in C.

This package

This package provides support for ATerms in Haskell. Currently this includes the following:

The module ATermLib is the top module of the library.

How to install

The modules of this library can be used as-is, but if you want to run checks, Hugs and GHC should be on your path.

How to use

1. Search path: Make sure the src directory is in your Haskell search path. For Hugs, this means you should use the -P command line switch.

2. Import ATermLib: Import the top level module ATermLib into your Haskell program.

3. Provide ATermConvertible instances: Provide instances of the ATermConvertible class for all the datatypes that you want to convert to/from ATerms. You can peek at Test.hs to figure out how. Automatic generation of instances is supported by the DrIFT pre-compiler. See below.

Automatic instance generation

The pre-compiler DrIFT can be used to generate instances of the ATermConvertible class automatically from your datatype definitions.

1. Get the Strafunski version of DrIFT from http://www.cs.vu.nl/Strafunski/.

2. Add the following DrIFT directive to your file:

    {-! global: ATermConvertible !-} 

3. Import the Haskell ATermLib into your file:

    import ATermLib 

4. Run DrIFT on your file.

    DrIFT YourFile.hs.src > YourFile.hs 

Authors

The Haskell ATerm Library was initiated by

  • Joost Visser (Universidade do Minho)

Improvements were contributed by:

  • Klaus Luettich (Universitaet Bremen)

Links

Modules
ATermAbstractSyntax
ATermConversion
ATermIO
ATermLib
ATermReadWrite
Produced by Haddock version 0.6