The StrategyLib package

[Tags:all-rights-reserved, library]

attempt to convert Strafunski's StrategyLib to a heirarchical library

[Skip to Readme]


Dependencies base, mtl [details]
License UnspecifiedLicense
Maintainer Samuel Bronson <>
Category Generics
Home page
Uploaded Sat Jul 14 19:16:04 UTC 2007 by SamuelBronson
Distributions NixOS:
Downloads 427 total (8 in the last 30 days)
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for StrategyLib

Readme for StrategyLib-


StrategyLib --- a library for generic programming with functional strategies


Table of contents

- Cross references (files with further information)
- Subdirectories of the source distribution
- Prerequisites for using the library and running examples
- Checking the installation (just do a "gmake check")
- Targets used by Makefile system
- Supported models of functional strategies


Cross references

AUTHORS   --- authors of Strafunski
COPYING   --- BSD-style copyright
INTALL    --- recommeneded versions of hugs/ghc/ghci/DrIFT
VERSION   --- version of StrategyLib
ChangeLog --- changes compared to previous version
TODO      --- issues to be addressed in the future


Subdirectories of the source distribution

library  --- implementation of functional strategies and StrategLib's themes
models   --- different models of functional strategies
scripts  --- reusable scripts (mainly includes for Makefiles)
examples --- examples of using functional strategies


Prerequisites for using the library and running examples

Either ghc or hugs or both, and maybe DrIFT.
See the file INSTALL for details.


Checking the installation

Just type in "gmake check" which provides you with a list of options
to check the distribution in different ways. The options differ
regarding the used Haskell implementations and regarding the fact
whether derived modules are to be regenerated with DrIFT or the
shipped versions will be used as is.


Targets used by Makefile system

You don't need to "make" anything since this is a source distribution,
but there are some make targets to run examples and do other things.
In applications of StrategyLib, one is encouraged to reuse some includes
for Makefiles as provided in subdirectory "scripts".

Targets in examples/*/Makefiles:

 run-hugs   --- run Main.hs with hugs
 run-ghci   --- run Main.hs with ghci
 run-ghc    --- run Main.hs with ghc 
 derive     --- run DrIFT if needed

Recursive clean targets:

 clean      --- remove backup files, object code, etc.
 very-clean --- also remove modules generated by DrIFT

Targets in the top-level Makefile:

 check      --- list detailed check options
 dist       --- build a distribution (to be implemented)


Supported models of functional strategies
We have played with quite a few models, and most of them are somewhat
supported by DrIFT, but for simplicity we only exercise two models in
the present distribution; see subdirectory "models":
- drift-default: a model based on a specific universal term representation
- deriving:      a model based on GHC's support for the Typeable/Data classes
Most subdirectories of ${StrategyLib}/examples assume the
"drift-default" model. In fact, we only demonstrate the difference for
the two models by having a "twosorts-drift-default" vs. a
"twosorts-deriving" example.



Examples are hosted in subdirectory examples.

two-sorts-drift-default --- the most trivial example; good for studying
two-sorts-derving       --- a variation requiring GHC's deriving support
little-lambda           --- a trivial example of language processing
joos-padl02             --- refactoring for a Java-subset (see PADL'02 paper)
joos-rule02             --- refactoring for a Java-subset (see RULE'02 paper)
haskell                 --- transformation of Haskell itself



- DrIFT      ---
- Strafunski ---