free
Version 5 revision 3 uploaded by phadej.
Package meta
- Synopsis
- Monads for free
- Description
Free monads are useful for many tree-like structures and domain specific languages.
If
f
is a Functor then the free Monad onf
is the type of trees whose nodes are labeled with the constructors off
. The word "free" is used in the sense of "unrestricted" rather than "zero-cost":Free f
makes no constraining assumptions beyond those given byf
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: http://comonad.com/reader/2008/monads-for-free/ http://comonad.com/reader/2011/free-monads-for-less/
- Author
- Edward A. Kmett
- Bug reports
- http://github.com/ekmett/free/issues
- Category
- Control, Monads
- Copyright
- Copyright (C) 2008-2015 Edward A. Kmett
- Homepage
- http://github.com/ekmett/free/
- Maintainer
- Edward A. Kmett <ekmett@gmail.com>
- Package URL
- n/a
- Stability
- provisional