This file is indexed.

/usr/share/doc/libghc-free-doc/html/Control-Applicative-Free-Final.html is in libghc-free-doc 4.12.4-3build4.

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
<!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.Applicative.Free.Final</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Control-Applicative-Free-Final.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Applicative-Free-Final.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.12.4: Monads for free</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>(C) 2012-2013 Edward Kmett</td></tr><tr><th>License</th><td>BSD-style (see the file LICENSE)</td></tr><tr><th>Maintainer</th><td>Edward Kmett &lt;ekmett@gmail.com&gt;</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Portability</th><td>GADTs, Rank2Types</td></tr><tr><th>Safe Haskell</th><td>Safe</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Control.Applicative.Free.Final</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Examples</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Final encoding of free <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a></code> functors.</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">newtype</span> <a href="#t:Ap">Ap</a> f a = <a href="#v:Ap">Ap</a> {<ul class="subs"><li><a href="#v:_runAp">_runAp</a> :: <span class="keyword">forall</span> g. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a> g =&gt; (<span class="keyword">forall</span> x. f x -&gt; g x) -&gt; g a</li></ul>}</li><li class="src short"><a href="#v:runAp">runAp</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a> g =&gt; (<span class="keyword">forall</span> x. f x -&gt; g x) -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a -&gt; g a</li><li class="src short"><a href="#v:runAp_">runAp_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Monoid.html#t:Monoid">Monoid</a> m =&gt; (<span class="keyword">forall</span> a. f a -&gt; m) -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b -&gt; m</li><li class="src short"><a href="#v:liftAp">liftAp</a> :: f a -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a</li><li class="src short"><a href="#v:hoistAp">hoistAp</a> :: (<span class="keyword">forall</span> a. f a -&gt; g a) -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> g b</li><li class="src short"><a href="#v:retractAp">retractAp</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a> f =&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a -&gt; f a</li></ul></div><div id="interface"><h1>Documentation</h1><div class="doc"><p>Compared to the free monad, they are less expressive. However, they are also more
 flexible to inspect and interpret, as the number of ways in which
 the values can be nested is more limited.</p></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a id="t:Ap" class="def">Ap</a> f a <a href="src/Control-Applicative-Free-Final.html#Ap" class="link">Source</a> <a href="#t:Ap" class="selflink">#</a></p><div class="doc"><p>The free <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a></code> for a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Functor.html#t:Functor">Functor</a></code> <code>f</code>.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Ap" class="def">Ap</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:_runAp" class="def">_runAp</a> :: <span class="keyword">forall</span> g. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a> g =&gt; (<span class="keyword">forall</span> x. f x -&gt; g x) -&gt; g a</dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:Ap" class="caption collapser" onclick="toggleSection('i:Ap')">Instances</p><div id="section.i:Ap" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Ap:Functor:1" class="instance expander" onclick="toggleSection('i:id:Ap:Functor:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Functor.html#t:Functor">Functor</a> (<a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f)</span> <a href="src/Control-Applicative-Free-Final.html#line-63" class="link">Source</a> <a href="#t:Ap" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Ap:Functor:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fmap">fmap</a> :: (a -&gt; b) -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b <a href="#v:fmap" class="selflink">#</a></p><p class="src"><a href="#v:-60--36-">(&lt;$)</a> :: a -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a <a href="#v:-60--36-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Ap:Applicative:2" class="instance expander" onclick="toggleSection('i:id:Ap:Applicative:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a> (<a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f)</span> <a href="src/Control-Applicative-Free-Final.html#line-69" class="link">Source</a> <a href="#t:Ap" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Ap:Applicative:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pure">pure</a> :: a -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a <a href="#v:pure" class="selflink">#</a></p><p class="src"><a href="#v:-60--42--62-">(&lt;*&gt;)</a> :: <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f (a -&gt; b) -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b <a href="#v:-60--42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-42--62-">(*&gt;)</a> :: <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b <a href="#v:-42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-60--42-">(&lt;*)</a> :: <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a <a href="#v:-60--42-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Ap:Apply:3" class="instance expander" onclick="toggleSection('i:id:Ap:Apply:3')"></span> <a href="file:///usr/share/doc/libghc-semigroupoids-doc/html/Data-Functor-Apply.html#t:Apply">Apply</a> (<a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f)</span> <a href="src/Control-Applicative-Free-Final.html#line-66" class="link">Source</a> <a href="#t:Ap" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Ap:Apply:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-60-.-62-">(&lt;.&gt;)</a> :: <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f (a -&gt; b) -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b <a href="#v:-60-.-62-" class="selflink">#</a></p><p class="src"><a href="#v:.-62-">(.&gt;)</a> :: <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b <a href="#v:.-62-" class="selflink">#</a></p><p class="src"><a href="#v:-60-.">(&lt;.)</a> :: <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a <a href="#v:-60-." class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:runAp" class="def">runAp</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a> g =&gt; (<span class="keyword">forall</span> x. f x -&gt; g x) -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a -&gt; g a <a href="src/Control-Applicative-Free-Final.html#runAp" class="link">Source</a> <a href="#v:runAp" class="selflink">#</a></p><div class="doc"><p>Given a natural transformation from <code>f</code> to <code>g</code>, this gives a canonical monoidal natural transformation from <code><code><a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a></code> f</code> to <code>g</code>.</p><pre>runAp t == retractApp . hoistApp t</pre></div></div><div class="top"><p class="src"><a id="v:runAp_" class="def">runAp_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Monoid.html#t:Monoid">Monoid</a> m =&gt; (<span class="keyword">forall</span> a. f a -&gt; m) -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b -&gt; m <a href="src/Control-Applicative-Free-Final.html#runAp_" class="link">Source</a> <a href="#v:runAp_" class="selflink">#</a></p><div class="doc"><p>Perform a monoidal analysis over free applicative value.</p><p>Example:</p><pre>count :: Ap f a -&gt; Int
count = getSum . runAp_ (\_ -&gt; Sum 1)
</pre></div></div><div class="top"><p class="src"><a id="v:liftAp" class="def">liftAp</a> :: f a -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a <a href="src/Control-Applicative-Free-Final.html#liftAp" class="link">Source</a> <a href="#v:liftAp" class="selflink">#</a></p><div class="doc"><p>A version of <code>lift</code> that can be used with just a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Functor.html#t:Functor">Functor</a></code> for <code>f</code>.</p></div></div><div class="top"><p class="src"><a id="v:hoistAp" class="def">hoistAp</a> :: (<span class="keyword">forall</span> a. f a -&gt; g a) -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f b -&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> g b <a href="src/Control-Applicative-Free-Final.html#hoistAp" class="link">Source</a> <a href="#v:hoistAp" class="selflink">#</a></p><div class="doc"><p>Given a natural transformation from <code>f</code> to <code>g</code> this gives a monoidal natural transformation from <code>Ap f</code> to <code>Ap g</code>.</p></div></div><div class="top"><p class="src"><a id="v:retractAp" class="def">retractAp</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a> f =&gt; <a href="Control-Applicative-Free-Final.html#t:Ap">Ap</a> f a -&gt; f a <a href="src/Control-Applicative-Free-Final.html#retractAp" class="link">Source</a> <a href="#v:retractAp" class="selflink">#</a></p><div class="doc"><p>Interprets the free applicative functor over f using the semantics for
   <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#v:pure">pure</a></code> and <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#v:-60--42--62-">&lt;*&gt;</a></code> given by the Applicative instance for f.</p><pre>retractApp == runAp id</pre></div></div><h1 id="g:1">Examples</h1><div class="doc"><p><a href="examples/ValidationForm.hs">Validation form</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>