The free package

[ Tags: bsd3, control, library, monads ] [ Propose Tags ]

Free monads are useful for many tree-like structures and domain specific languages.

If f is a Functor then the free Monad on f is the type of trees whose nodes are labeled with the constructors of f. The word "free" is used in the sense of "unrestricted" rather than "zero-cost": Free f makes no constraining assumptions beyond those given by f and the definition of Monad. As used here it is a standard term from the mathematical theory of adjoint functors.

Cofree comonads are dual to free monads. They provide convenient ways to talk about branching streams and rose-trees, and can be used to annotate syntax trees. The cofree comonad can be seen as a stream parameterized by a Functor that controls its branching factor.

More information on free monads, including examples, can be found in the following blog posts:

[Skip to Readme]


Versions 0.1.0, 0.1.1, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 1.8.0,,,, 2.0, 2.0.1,, 2.0.2, 2.0.3, 2.1, 2.1.1,, 2.2, 3.0, 3.1, 3.1.1, 3.2, 3.3,,, 3.3.1, 3.4, 3.4.1, 3.4.2, 4.0, 4.1, 4.2, 4.4, 4.5, 4.6, 4.6.1, 4.7, 4.7.1, 4.8,, 4.9,, 4.11, 4.12, 4.12.1, 4.12.2, 4.12.3, 4.12.4
Change log CHANGELOG.markdown
Dependencies base (>=4 && <4.8), bifunctors (==4.*), comonad (==4.*), distributive (>=0.2.1), mtl (>= && <2.2), prelude-extras (>=0.4 && <1), profunctors (==4.*), semigroupoids (==4.*), semigroups (>= && <1), template-haskell (>= && <3), transformers (>=0.2.0 && <0.4) [details]
License BSD3
Copyright Copyright (C) 2008-2013 Edward A. Kmett
Author Edward A. Kmett
Maintainer Edward A. Kmett <>
Category Control, Monads
Home page
Bug tracker
Source repository head: git clone git://
Uploaded Sat Apr 19 06:23:19 UTC 2014 by EdwardKmett
Updated Tue Dec 2 10:54:46 UTC 2014 by HerbertValerioRiedel to revision 1   [What is this?]
Distributions Arch:4.12.4, Debian:4.12.1, Fedora:4.12.4, FreeBSD:4.12.1, LTSHaskell:4.12.4, NixOS:4.12.4, Stackage:4.12.4, Tumbleweed:4.12.4
Downloads 142697 total (4376 in the last 30 days)
Rating 2.5 (votes: 3) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Successful builds reported [all 1 reports]
Hackage Matrix CI




Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees

Readme for free-4.7

[back to package description]


Build Status

This package provides a common definitions for working with free monads, free applicatives, and cofree comonads in Haskell.

Contact Information

Contributions and bug reports are welcome!

Please feel free to contact me through github or on the #haskell IRC channel on

-Edward Kmett