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: https://ekmett.github.io/reader/2008/monads-for-free/ https://ekmett.github.io/reader/2011/free-monads-for-less/


Keywords
control, library, monads, Propose Tags, https://ekmett.github.io/reader/2008/monads-for-free/, https://ekmett.github.io/reader/2011/free-monads-for-less/, Skip to Readme, , Index, Quick Jump, Control.Alternative.Free, Control.Alternative.Free.Final, Control.Applicative.Free, Control.Applicative.Free.Fast, Control.Applicative.Free.Final, Control.Applicative.Trans.Free, Control.Comonad.Cofree, Control.Comonad.Cofree.Class, Control.Comonad.Trans.Cofree, Control.Comonad.Trans.Coiter, Control.Monad.Free, Control.Monad.Free.Ap, Control.Monad.Free.Church, Control.Monad.Free.Class, Control.Monad.Free.TH, Control.Monad.Trans.Free, Control.Monad.Trans.Free.Ap, Control.Monad.Trans.Free.Church, Control.Monad.Trans.Iter, free-5.2.tar.gz, browse, Package description, revised, metadata revisions, Package maintainers, EdwardKmett, EricMertens, JohnWiegley, ryanglscott, edit package information , 5.0.2
License
BSD-3-Clause
Install
cabal install free-5.2

Documentation

free

Hackage 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 irc.freenode.net.

-Edward Kmett