/usr/share/doc/libghc-free-doc/html/Control-Applicative-Free.html is in libghc-free-doc 4.12.1-2build1.
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 | <!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</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-Applicative-Free.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Applicative-Free.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.1: Monads for free</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>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 <ekmett@gmail.com></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</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><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a></code> functors for free</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:Ap">Ap</a> f a <span class="keyword">where</span><ul class="subs"><li><a href="#v:Pure">Pure</a> :: a -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f a</li><li><a href="#v:Ap">Ap</a> :: f a -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f (a -> b) -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f b</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.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> g => (<span class="keyword">forall</span> x. f x -> g x) -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f a -> 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.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> m => (<span class="keyword">forall</span> a. f a -> m) -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f b -> m</li><li class="src short"><a href="#v:liftAp">liftAp</a> :: f a -> <a href="Control-Applicative-Free.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 -> g a) -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f b -> <a href="Control-Applicative-Free.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.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f => <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f a -> 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><p>See <a href="http://arxiv.org/abs/1403.0749">Free Applicative Functors</a>,
by Paolo Capriotti and Ambrus Kaposi, for some applications.</p></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Ap" class="def">Ap</a> f a <span class="keyword">where</span> <a href="src/Control-Applicative-Free.html#Ap" class="link">Source</a></p><div class="doc"><p>The free <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a></code> for a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.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 name="v:Pure" class="def">Pure</a> :: a -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f a</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:Ap" class="def">Ap</a> :: f a -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f (a -> b) -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f b</td><td class="doc empty"> </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"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Functor.html#t:Functor">Functor</a> (<a href="Control-Applicative-Free.html#t:Ap">Ap</a> f)</span> <a href="src/Control-Applicative-Free.html#line-78" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> (<a href="Control-Applicative-Free.html#t:Ap">Ap</a> f)</span> <a href="src/Control-Applicative-Free.html#line-86" class="link">Source</a></td><td class="doc empty"> </td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-semigroupoids-doc/html/Data-Functor-Apply.html#t:Apply">Apply</a> (<a href="Control-Applicative-Free.html#t:Ap">Ap</a> f)</span> <a href="src/Control-Applicative-Free.html#line-82" class="link">Source</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:runAp" class="def">runAp</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> g => (<span class="keyword">forall</span> x. f x -> g x) -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f a -> g a <a href="src/Control-Applicative-Free.html#runAp" class="link">Source</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.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 name="v:runAp_" class="def">runAp_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> m => (<span class="keyword">forall</span> a. f a -> m) -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f b -> m <a href="src/Control-Applicative-Free.html#runAp_" class="link">Source</a></p><div class="doc"><p>Perform a monoidal analysis over free applicative value.</p><p>Example:</p><pre>count :: Ap f a -> Int
count = getSum . runAp_ (\_ -> Sum 1)
</pre></div></div><div class="top"><p class="src"><a name="v:liftAp" class="def">liftAp</a> :: f a -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f a <a href="src/Control-Applicative-Free.html#liftAp" class="link">Source</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.8.2.0/Data-Functor.html#t:Functor">Functor</a></code> for <code>f</code>.</p></div></div><div class="top"><p class="src"><a name="v:hoistAp" class="def">hoistAp</a> :: (<span class="keyword">forall</span> a. f a -> g a) -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f b -> <a href="Control-Applicative-Free.html#t:Ap">Ap</a> g b <a href="src/Control-Applicative-Free.html#hoistAp" class="link">Source</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 name="v:retractAp" class="def">retractAp</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f => <a href="Control-Applicative-Free.html#t:Ap">Ap</a> f a -> f a <a href="src/Control-Applicative-Free.html#retractAp" class="link">Source</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.8.2.0/Control-Applicative.html#v:pure">pure</a></code> and <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:-60--42--62-"><*></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.16.1</p></div></body></html>
|