The free-theorems package

[Tags:library, public-domain]

The free-theorems library allows to automatically generate free theorems from Haskell type expressions. It supports nearly all Haskell 98 types except of type constructor classes, and in addition it can also handle higher-rank functions. Free theorems are generated for three different sublanguages of Haskell, a basic one corresponding to the polymorphic lambda-calculus of Girard-Reynolds, an extension of that allowing for recursion and errors, and finally a sublanguage additionally allowing seq. In the last two sublanguages, also inequational free theorems may be derived in addition to classical equational results.

[Skip to Readme]


Versions 0.2, 0.2.1, 0.3, 0.3.1,,,,
Dependencies base (>=1.0), containers (>=, haskell-src (>=1.0), haskell-src-exts (>=0.3.9), mtl (>=1.0), pretty (>= [details]
License PublicDomain
Author Sascha Boehme
Stability Unknown
Category Language
Uploaded Fri Oct 17 14:16:23 UTC 2008 by JoachimBreitner
Distributions NixOS:
Downloads 1865 total (9 in the last 30 days)
0 []
Status Docs not available [build log]
All reported builds failed as of 2017-01-02 [all 7 reports]


  • Language
    • Haskell
      • Language.Haskell.FreeTheorems
        • Parser
          • Language.Haskell.FreeTheorems.Parser.Haskell98
          • Language.Haskell.FreeTheorems.Parser.Hsx
        • Language.Haskell.FreeTheorems.Syntax
        • Language.Haskell.FreeTheorems.Theorems


Maintainer's Corner

For package maintainers and hackage trustees

Readme for free-theorems

Readme for free-theorems-0.3


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.