Package Info

ghc-free


Monads for free


Unspecified

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: <http://comonad.com/reader/2008/monads-for-free/&gt; <http://comonad.com/reader/2011/free-monads-for-less/&gt;.


License: BSD-3-Clause
URL: https://hackage.haskell.org/package/free

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
4.12.4-2.3 info 5585 2016-09-14 12 GA-SP5
  • ppc64le
  • ghc-free
  • ghc-free-devel
4.12.4-2.7 info 5585 2016-09-14 12 GA-SP5
  • AArch64
  • s390x
  • x86-64
  • ghc-free
  • ghc-free-devel
4.12.4-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • x86-64
  • ghc-free
  • ghc-free-devel
5.1-bp151.1.10 info GA Release 2019-05-31 15 SP1
  • AArch64
  • ghc-free
  • ghc-free-devel
5.1-bp151.2.2 info GA Release 2019-07-17 15 SP1
  • ppc64le
  • x86-64
  • ghc-free
  • ghc-free-devel
5.1.3-bp152.1.10 info GA Release 2020-05-23 15 SP2
  • AArch64
  • ppc64le
  • x86-64
  • ghc-free
  • ghc-free-devel
5.1.3-bp153.1.20 info GA Release 2021-04-08 15 SP3
  • AArch64
  • ppc64le
  • x86-64
  • ghc-free
  • ghc-free-devel