This file is indexed.

/usr/share/doc/libghc-free-doc/html/Control-Comonad-Cofree.html is in libghc-free-doc 4.2-1build3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Control.Comonad.Cofree</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Control-Comonad-Cofree.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Comonad-Cofree.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">free-4.2: Monads for free</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>MPTCs, fundeps</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>Edward Kmett &lt;ekmett@gmail.com&gt;</td></tr><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Control.Comonad.Cofree</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Lenses into cofree comonads
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Cofree comonads
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span>  <a href="#t:Cofree">Cofree</a> f a = a <a href="#v::-60-">:&lt;</a> (f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a))</li><li class="src short"><span class="keyword">class</span> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f, <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a> w) =&gt; <a href="#t:ComonadCofree">ComonadCofree</a> f w | w -&gt; f <span class="keyword">where</span><ul class="subs"><li><a href="#v:unwrap">unwrap</a> ::  w a -&gt; f (w a)</li></ul></li><li class="src short"><a href="#v:section">section</a> :: <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a> f =&gt; f a -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a</li><li class="src short"><a href="#v:coiter">coiter</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; (a -&gt; f a) -&gt; a -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a</li><li class="src short"><a href="#v:unfold">unfold</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; (b -&gt; (a, f b)) -&gt; b -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a</li><li class="src short"><a href="#v:_extract">_extract</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; (a -&gt; f a) -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a -&gt; f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a)</li><li class="src short"><a href="#v:_unwrap">_unwrap</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; (g (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a) -&gt; f (g (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a))) -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a -&gt; f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a)</li><li class="src short"><a href="#v:telescoped">telescoped</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> g) =&gt; [(<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a -&gt; f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a)) -&gt; g (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a) -&gt; f (g (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a))] -&gt; (a -&gt; f a) -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a -&gt; f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a)</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Cofree" class="def">Cofree</a> f a <a href="src/Control-Comonad-Cofree.html#Cofree" class="link">Source</a></p><div class="doc"><p>The <code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> <code><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a></code> of a functor <code>f</code>.
</p><p><em>Formally</em>
</p><p>A <code><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a></code> <code>v</code> is a cofree <code><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a></code> for <code>f</code> if every comonad homomorphism
 another comonad <code>w</code> to <code>v</code> is equivalent to a natural transformation
 from <code>w</code> to <code>f</code>.
</p><p>A <code>cofree</code> functor is right adjoint to a forgetful functor.
</p><p>Cofree is a functor from the category of functors to the category of comonads
 that is right adjoint to the forgetful functor from the category of comonads
 to the category of functors that forgets how to <code><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#v:extract">extract</a></code> and
 <code><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#v:duplicate">duplicate</a></code>, leaving you with only a <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a></code>.
</p><p>In practice, cofree comonads are quite useful for annotating syntax trees,
 or talking about streams.
</p><p>A number of common comonads arise directly as cofree comonads.
</p><p>For instance,
</p><ul><li> <code><code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a></code></code> forms the a comonad for a non-empty list.
</li><li> <code><code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> (<code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Applicative.html#t:Const">Const</a></code> b)</code> is a product.
</li><li> <code><code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> <code>Identity</code></code> forms an infinite stream.
</li><li> <code><code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> ((-&gt;) b)'</code> describes a Moore machine with states labeled with values of type a, and transitions on edges of type b.
</li></ul></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src">a <a name="v::-60-" class="def">:&lt;</a> (f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a))</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:Cofree" class="caption collapser" onclick="toggleSection('i:Cofree')">Instances</p><div id="section.i:Cofree" class="show"><table><tr><td class="src"><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Trans-Class.html#t:ComonadTrans">ComonadTrans</a> <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></td><td class="doc"><p>This is not a true <code><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a></code> transformer, but this instance is convenient.
</p></td></tr><tr><td class="src"><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Traced-Class.html#t:ComonadTraced">ComonadTraced</a> m w =&gt; <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Traced-Class.html#t:ComonadTraced">ComonadTraced</a> m (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> w)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Store-Class.html#t:ComonadStore">ComonadStore</a> s w =&gt; <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Store-Class.html#t:ComonadStore">ComonadStore</a> s (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> w)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Env-Class.html#t:ComonadEnv">ComonadEnv</a> e w =&gt; <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Env-Class.html#t:ComonadEnv">ComonadEnv</a> e (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> w)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; <a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Monad">Monad</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Typeable-Internal.html#t:Typeable1">Typeable1</a> f =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Typeable-Internal.html#t:Typeable1">Typeable1</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Applicative.html#t:Applicative">Applicative</a> f =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Applicative.html#t:Applicative">Applicative</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Foldable.html#t:Foldable">Foldable</a> f =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Foldable.html#t:Foldable">Foldable</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Traversable.html#t:Traversable">Traversable</a> f =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Traversable.html#t:Traversable">Traversable</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:ComonadApply">ComonadApply</a> f =&gt; <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:ComonadApply">ComonadApply</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/libghc-distributive-doc/html/Data-Distributive.html#t:Distributive">Distributive</a> f =&gt; <a href="/usr/share/doc/libghc-distributive-doc/html/Data-Distributive.html#t:Distributive">Distributive</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/libghc-semigroupoids-doc/html/Data-Semigroup-Traversable.html#t:Traversable1">Traversable1</a> f =&gt; <a href="/usr/share/doc/libghc-semigroupoids-doc/html/Data-Semigroup-Traversable.html#t:Traversable1">Traversable1</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/libghc-semigroupoids-doc/html/Data-Semigroup-Foldable.html#t:Foldable1">Foldable1</a> f =&gt; <a href="/usr/share/doc/libghc-semigroupoids-doc/html/Data-Semigroup-Foldable.html#t:Foldable1">Foldable1</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/libghc-semigroupoids-doc/html/Data-Functor-Bind.html#t:Apply">Apply</a> f =&gt; <a href="/usr/share/doc/libghc-semigroupoids-doc/html/Data-Functor-Bind.html#t:Apply">Apply</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; <a href="/usr/share/doc/libghc-semigroupoids-doc/html/Data-Functor-Extend.html#t:Extend">Extend</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> (f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)), <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> a) =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Typeable-Internal.html#t:Typeable1">Typeable1</a> f, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Data.html#t:Data">Data</a> (f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)), <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Data.html#t:Data">Data</a> a) =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Data.html#t:Data">Data</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> (f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)), <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> a) =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Read.html#t:Read">Read</a> (f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)), <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Read.html#t:Read">Read</a> a) =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Read.html#t:Read">Read</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> (f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)), <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> a) =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Typeable-Internal.html#t:Typeable1">Typeable1</a> f, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Typeable-Internal.html#t:Typeable">Typeable</a> a) =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Typeable-Internal.html#t:Typeable">Typeable</a> (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f, <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a> w) =&gt; <a name="t:ComonadCofree" class="def">ComonadCofree</a> f w | w -&gt; f <span class="keyword">where</span><a href="src/Control-Comonad-Cofree-Class.html#ComonadCofree" class="link">Source</a></p><div class="doc"><p>Allows you to peel a layer off a cofree comonad.
</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:unwrap" class="def">unwrap</a> ::  w a -&gt; f (w a)<a href="src/Control-Comonad-Cofree-Class.html#unwrap" class="link">Source</a></p><div class="doc"><p>Remove a layer.
</p></div></div><div class="subs instances"><p id="control.i:ComonadCofree" class="caption collapser" onclick="toggleSection('i:ComonadCofree')">Instances</p><div id="section.i:ComonadCofree" class="show"><table><tr><td class="src"><a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/libghc-semigroups-doc/html/Data-List-NonEmpty.html#t:NonEmpty">NonEmpty</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> f w =&gt; <a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> f (<a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Trans-Identity.html#t:IdentityT">IdentityT</a> w)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; <a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a> w =&gt; <a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> <a href="/usr/share/doc/libghc-transformers-doc/html/Data-Functor-Identity.html#t:Identity">Identity</a> (<a href="Control-Comonad-Trans-Coiter.html#t:CoiterT">CoiterT</a> w)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> f w, <a href="/usr/share/doc/libghc-semigroups-doc/html/Data-Semigroup.html#t:Semigroup">Semigroup</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Monoid">Monoid</a> m) =&gt; <a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> f (<a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Trans-Traced.html#t:TracedT">TracedT</a> m w)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> f w =&gt; <a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> f (<a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Trans-Store.html#t:StoreT">StoreT</a> s w)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> f w =&gt; <a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> f (<a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Trans-Env.html#t:EnvT">EnvT</a> e w)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f, <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a> w) =&gt; <a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> f (<a href="Control-Comonad-Trans-Cofree.html#t:CofreeT">CofreeT</a> f w)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Control-Comonad-Cofree.html#t:ComonadCofree">ComonadCofree</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Applicative.html#t:Const">Const</a> b) (<a href="/usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.3.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> b)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:section" class="def">section</a> :: <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a> f =&gt; f a -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a<a href="src/Control-Comonad-Cofree.html#section" class="link">Source</a></p><div class="doc"><pre><code><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Trans-Class.html#v:lower">lower</a></code> . <code><a href="Control-Comonad-Cofree.html#v:section">section</a></code> = <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Category.html#v:id">id</a></code></pre></div></div><div class="top"><p class="src"><a name="v:coiter" class="def">coiter</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; (a -&gt; f a) -&gt; a -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a<a href="src/Control-Comonad-Cofree.html#coiter" class="link">Source</a></p><div class="doc"><p>Use coiteration to generate a cofree comonad from a seed.
</p><pre><code><a href="Control-Comonad-Cofree.html#v:coiter">coiter</a></code> f = <code><a href="Control-Comonad-Cofree.html#v:unfold">unfold</a></code> (<code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Category.html#v:id">id</a></code> <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Arrow.html#t:-38--38--38-">&amp;&amp;&amp;</a></code> f)</pre></div></div><div class="top"><p class="src"><a name="v:unfold" class="def">unfold</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; (b -&gt; (a, f b)) -&gt; b -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> f a<a href="src/Control-Comonad-Cofree.html#unfold" class="link">Source</a></p><div class="doc"><p>Unfold a cofree comonad from a seed.
</p></div></div><h1 id="g:1">Lenses into cofree comonads
</h1><div class="top"><p class="src"><a name="v:_extract" class="def">_extract</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; (a -&gt; f a) -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a -&gt; f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a)<a href="src/Control-Comonad-Cofree.html#_extract" class="link">Source</a></p><div class="doc"><p>This is a lens that can be used to read or write from the target of <code><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#v:extract">extract</a></code>.
</p><p>Using (^.) from the <code>lens</code> package:
</p><pre>foo ^. <code><a href="Control-Comonad-Cofree.html#v:_extract">_extract</a></code> == <code><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#v:extract">extract</a></code> foo</pre><p>For more on lenses see the <code>lens</code> package on hackage
</p><pre><code><a href="Control-Comonad-Cofree.html#v:_extract">_extract</a></code> :: Lens' (<code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> g a) a</pre></div></div><div class="top"><p class="src"><a name="v:_unwrap" class="def">_unwrap</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f =&gt; (g (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a) -&gt; f (g (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a))) -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a -&gt; f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a)<a href="src/Control-Comonad-Cofree.html#_unwrap" class="link">Source</a></p><div class="doc"><p>This is a lens that can be used to read or write to the tails of a <code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> <code><a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad.html#t:Comonad">Comonad</a></code>.
</p><p>Using (^.) from the <code>lens</code> package:
</p><pre>foo ^. <code><a href="Control-Comonad-Cofree.html#v:_unwrap">_unwrap</a></code> == <code><a href="Control-Comonad-Cofree.html#v:unwrap">unwrap</a></code> foo</pre><p>For more on lenses see the <code>lens</code> package on hackage
</p><pre><code><a href="Control-Comonad-Cofree.html#v:_unwrap">_unwrap</a></code> :: Lens' (<code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> g a) (g (<code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> g a))</pre></div></div><div class="top"><p class="src"><a name="v:telescoped" class="def">telescoped</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> g) =&gt; [(<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a -&gt; f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a)) -&gt; g (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a) -&gt; f (g (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a))] -&gt; (a -&gt; f a) -&gt; <a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a -&gt; f (<a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a> g a)<a href="src/Control-Comonad-Cofree.html#telescoped" class="link">Source</a></p><div class="doc"><p>Construct a <code>Lens</code> into a <code><code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> f</code> given a list of lenses into the base functor.
</p><p>For more on lenses see the <code>lens</code> package on hackage.
</p><pre>telescoped :: <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a></code> g =&gt; [Lens' (<code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> g a) (g (<code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> g a))] -&gt; Lens' (<code><a href="Control-Comonad-Cofree.html#t:Cofree">Cofree</a></code> g a) a</pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>