Automatic generation of free theorems.

Latest on Hackage:

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

PublicDomain licensed by Sascha Boehme


This library may be used to automatically generate free theorems
[1,2] from Haskell type signatures. It supports Haskell 98 and
additionally higher-rank functions. Beside primitive Haskell types
(Int, Integer, Float, Double, Char), it already includes lists and
tuples. The library provides means to add other data types.


See the file `free-theorems.cabal' for dependencies. Note that there,
two parser libraries are listed. If only one is needed, the library
is easily adjustable by commenting out the corresponding dependencies
and exported modules.


Since this library is cabalised, it uses the standard installation

runhaskell Setup.lhs configure
runhaskell Setup.lhs build
runhaskell Setup.lhs install


See the Haddock-generated documentation for detailed information on
how to use this library.


If Haddock is available, documentation may be
generated automatically from the sources.

runhaskell Setup.lhs haddock


[1] Philip Wadler, Theorems for free!, In Functional Programming
Languages and Computer Architecture, Proceedings, 1989.

[2] Patricia Johann and Janis Voigtländer, The Impact of seq on Free
Theorems-Based Program Transformations, In Fundamenta
Informaticae, 2006.

comments powered byDisqus