This file is indexed.

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

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
<!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.Trans.Free</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-Trans-Free.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Applicative-Trans-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.4: 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 &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.Trans.Free</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Free Applicative</a></li><li><a href="#g:2">Free Alternative</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.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a></code> functor transformers 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">newtype</span> <a href="#t:ApT">ApT</a> f g a = <a href="#v:ApT">ApT</a> {<ul class="subs"><li><a href="#v:getApT">getApT</a> :: g (<a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g a)</li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:ApF">ApF</a> f g a <span class="keyword">where</span><ul class="subs"><li><a href="#v:Pure">Pure</a> :: a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g a</li><li><a href="#v:Ap">Ap</a> :: f a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g (a -&gt; b) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b</li></ul></li><li class="src short"><a href="#v:liftApT">liftApT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> g =&gt; f a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a</li><li class="src short"><a href="#v:liftApO">liftApO</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a</li><li class="src short"><a href="#v:runApT">runApT</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> h, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g) =&gt; (<span class="keyword">forall</span> a. f a -&gt; h a) -&gt; (<span class="keyword">forall</span> a. g (h a) -&gt; h a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; h b</li><li class="src short"><a href="#v:runApF">runApF</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> h, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g) =&gt; (<span class="keyword">forall</span> a. f a -&gt; h a) -&gt; (<span class="keyword">forall</span> a. g (h a) -&gt; h a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b -&gt; h b</li><li class="src short"><a href="#v:runApT_">runApT_</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> m) =&gt; (<span class="keyword">forall</span> a. f a -&gt; m) -&gt; (g m -&gt; m) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; m</li><li class="src short"><a href="#v:hoistApT">hoistApT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f' g b</li><li class="src short"><a href="#v:hoistApF">hoistApF</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f' g b</li><li class="src short"><a href="#v:transApT">transApT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; (<span class="keyword">forall</span> a. g a -&gt; g' a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g' b</li><li class="src short"><a href="#v:transApF">transApF</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; (<span class="keyword">forall</span> a. g a -&gt; g' a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g' b</li><li class="src short"><a href="#v:joinApT">joinApT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f m a -&gt; m (<a href="Control-Applicative-Trans-Free.html#t:Ap">Ap</a> f a)</li><li class="src short"><span class="keyword">type</span> <a href="#t:Ap">Ap</a> f = <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor-Identity.html#t:Identity">Identity</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.0.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-Trans-Free.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.0.0/Data-Monoid.html#t:Monoid">Monoid</a> m =&gt; (<span class="keyword">forall</span> x. f x -&gt; m) -&gt; <a href="Control-Applicative-Trans-Free.html#t:Ap">Ap</a> f a -&gt; m</li><li class="src short"><a href="#v:retractAp">retractAp</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> f =&gt; <a href="Control-Applicative-Trans-Free.html#t:Ap">Ap</a> f a -&gt; f a</li><li class="src short"><span class="keyword">type</span> <a href="#t:Alt">Alt</a> f = <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f []</li><li class="src short"><a href="#v:runAlt">runAlt</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> g, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Foldable.html#t:Foldable">Foldable</a> t) =&gt; (<span class="keyword">forall</span> x. f x -&gt; g x) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f t a -&gt; g a</li></ul></div><div id="interface"><h1>Documentation</h1><div class="doc"><p>Compared to the free monad transformers, 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://paolocapriotti.com/assets/applicative.pdf">Free Applicative Functors</a>,
 by Paolo Capriotti and Ambrus Kaposi, for some applications.</p></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a id="t:ApT" class="def">ApT</a> f g a <a href="src/Control-Applicative-Trans-Free.html#ApT" class="link">Source</a> <a href="#t:ApT" class="selflink">#</a></p><div class="doc"><p>The free <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a></code> transformer for a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a></code> <code>f</code> over
 <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a></code> <code>g</code>.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:ApT" class="def">ApT</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:getApT" class="def">getApT</a> :: g (<a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g a)</dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:ApT" class="caption collapser" onclick="toggleSection('i:ApT')">Instances</p><div id="section.i:ApT" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:ApT:Functor:1" class="instance expander" onclick="toggleSection('i:id:ApT:Functor:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> (<a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g)</span> <a href="src/Control-Applicative-Trans-Free.html#line-79" class="link">Source</a> <a href="#t:ApT" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:ApT: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-Trans-Free.html#t:ApT">ApT</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g 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-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g 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:ApT:Applicative:2" class="instance expander" onclick="toggleSection('i:id:ApT:Applicative:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> g =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> (<a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g)</span> <a href="src/Control-Applicative-Trans-Free.html#line-90" class="link">Source</a> <a href="#t:ApT" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:ApT: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-Trans-Free.html#t:ApT">ApT</a> f g 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-Trans-Free.html#t:ApT">ApT</a> f g (a -&gt; b) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g 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-Trans-Free.html#t:ApT">ApT</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b <a href="#v:-42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-60--42-">(&lt;*)</a> :: <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g 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:ApT:Alternative:3" class="instance expander" onclick="toggleSection('i:id:ApT:Alternative:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> g =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> (<a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g)</span> <a href="src/Control-Applicative-Trans-Free.html#line-104" class="link">Source</a> <a href="#t:ApT" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:ApT:Alternative:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:empty">empty</a> :: <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a <a href="#v:empty" class="selflink">#</a></p><p class="src"><a href="#v:-60--124--62-">(&lt;|&gt;)</a> :: <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a <a href="#v:-60--124--62-" class="selflink">#</a></p><p class="src"><a href="#v:some">some</a> :: <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g [a] <a href="#v:some" class="selflink">#</a></p><p class="src"><a href="#v:many">many</a> :: <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g [a] <a href="#v:many" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:ApT:Apply:4" class="instance expander" onclick="toggleSection('i:id:ApT:Apply:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> g =&gt; <a href="file:///usr/share/doc/libghc-semigroupoids-doc/html/Data-Functor-Apply.html#t:Apply">Apply</a> (<a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g)</span> <a href="src/Control-Applicative-Trans-Free.html#line-100" class="link">Source</a> <a href="#t:ApT" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:ApT:Apply:4" 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-Trans-Free.html#t:ApT">ApT</a> f g (a -&gt; b) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b <a href="#v:-60-.-62-" class="selflink">#</a></p><p class="src"><a href="#v:.-62-">(.&gt;)</a> :: <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b <a href="#v:.-62-" class="selflink">#</a></p><p class="src"><a href="#v:-60-.">(&lt;.)</a> :: <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a <a href="#v:-60-." class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:ApF" class="def">ApF</a> f g a <span class="keyword">where</span> <a href="src/Control-Applicative-Trans-Free.html#ApF" class="link">Source</a> <a href="#t:ApF" class="selflink">#</a></p><div class="doc"><p>The free <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.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.0.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:Pure" class="def">Pure</a> :: a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g a</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:Ap" class="def">Ap</a> :: f a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g (a -&gt; b) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:ApF" class="caption collapser" onclick="toggleSection('i:ApF')">Instances</p><div id="section.i:ApF" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:ApF:Functor:1" class="instance expander" onclick="toggleSection('i:id:ApF:Functor:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> (<a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g)</span> <a href="src/Control-Applicative-Trans-Free.html#line-75" class="link">Source</a> <a href="#t:ApF" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:ApF: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-Trans-Free.html#t:ApF">ApF</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g 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-Trans-Free.html#t:ApF">ApF</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g 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:ApF:Applicative:2" class="instance expander" onclick="toggleSection('i:id:ApF:Applicative:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> g =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> (<a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g)</span> <a href="src/Control-Applicative-Trans-Free.html#line-82" class="link">Source</a> <a href="#t:ApF" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:ApF: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-Trans-Free.html#t:ApF">ApF</a> f g 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-Trans-Free.html#t:ApF">ApF</a> f g (a -&gt; b) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g 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-Trans-Free.html#t:ApF">ApF</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b <a href="#v:-42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-60--42-">(&lt;*)</a> :: <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g 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:ApF:Apply:3" class="instance expander" onclick="toggleSection('i:id:ApF:Apply:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> g =&gt; <a href="file:///usr/share/doc/libghc-semigroupoids-doc/html/Data-Functor-Apply.html#t:Apply">Apply</a> (<a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g)</span> <a href="src/Control-Applicative-Trans-Free.html#line-96" class="link">Source</a> <a href="#t:ApF" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:ApF: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-Trans-Free.html#t:ApF">ApF</a> f g (a -&gt; b) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b <a href="#v:-60-.-62-" class="selflink">#</a></p><p class="src"><a href="#v:.-62-">(.&gt;)</a> :: <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b <a href="#v:.-62-" class="selflink">#</a></p><p class="src"><a href="#v:-60-.">(&lt;.)</a> :: <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g 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:liftApT" class="def">liftApT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> g =&gt; f a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a <a href="src/Control-Applicative-Trans-Free.html#liftApT" class="link">Source</a> <a href="#v:liftApT" class="selflink">#</a></p><div class="doc"><p>A version of <code>lift</code> that can be used with no constraint for <code>f</code>.</p></div></div><div class="top"><p class="src"><a id="v:liftApO" class="def">liftApO</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; g a -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g a <a href="src/Control-Applicative-Trans-Free.html#liftApO" class="link">Source</a> <a href="#v:liftApO" class="selflink">#</a></p><div class="doc"><p>Lift an action of the &quot;outer&quot; <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a></code> <code>g a</code> to <code><code><a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a></code> f g a</code>.</p></div></div><div class="top"><p class="src"><a id="v:runApT" class="def">runApT</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> h, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g) =&gt; (<span class="keyword">forall</span> a. f a -&gt; h a) -&gt; (<span class="keyword">forall</span> a. g (h a) -&gt; h a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; h b <a href="src/Control-Applicative-Trans-Free.html#runApT" class="link">Source</a> <a href="#v:runApT" class="selflink">#</a></p><div class="doc"><p>Given natural transformations <code>f ~&gt; h</code> and <code>g . h ~&gt; h</code> this gives
 a natural transformation <code>ApT f g ~&gt; h</code>.</p></div></div><div class="top"><p class="src"><a id="v:runApF" class="def">runApF</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> h, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g) =&gt; (<span class="keyword">forall</span> a. f a -&gt; h a) -&gt; (<span class="keyword">forall</span> a. g (h a) -&gt; h a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b -&gt; h b <a href="src/Control-Applicative-Trans-Free.html#runApF" class="link">Source</a> <a href="#v:runApF" class="selflink">#</a></p><div class="doc"><p>Given natural transformations <code>f ~&gt; h</code> and <code>g . h ~&gt; h</code> this gives
 a natural transformation <code>ApF f g ~&gt; h</code>.</p></div></div><div class="top"><p class="src"><a id="v:runApT_" class="def">runApT_</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> m) =&gt; (<span class="keyword">forall</span> a. f a -&gt; m) -&gt; (g m -&gt; m) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; m <a href="src/Control-Applicative-Trans-Free.html#runApT_" class="link">Source</a> <a href="#v:runApT_" class="selflink">#</a></p><div class="doc"><p>Perform a monoidal analysis over <code><code><a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a></code> f g b</code> value.</p><p>Examples:</p><pre>height :: (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a></code> g, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Foldable.html#t:Foldable">Foldable</a></code> g) =&gt; <code><a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a></code> f g a -&gt; <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></code>
height = <code>getSum</code> . runApT_ (_ -&gt; <code>Sum</code> 1) <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Foldable.html#v:maximum">maximum</a></code>
</pre><pre>size :: (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a></code> g, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Foldable.html#t:Foldable">Foldable</a></code> g) =&gt; <code><a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a></code> f g a -&gt; <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></code>
size = <code>getSum</code> . runApT_ (_ -&gt; <code>Sum</code> 1) <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Foldable.html#v:fold">fold</a></code>
</pre></div></div><div class="top"><p class="src"><a id="v:hoistApT" class="def">hoistApT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f' g b <a href="src/Control-Applicative-Trans-Free.html#hoistApT" class="link">Source</a> <a href="#v:hoistApT" class="selflink">#</a></p><div class="doc"><p>Given a natural transformation from <code>f</code> to <code>f'</code> this gives a monoidal natural transformation from <code>ApT f g</code> to <code>ApT f' g</code>.</p></div></div><div class="top"><p class="src"><a id="v:hoistApF" class="def">hoistApF</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f' g b <a href="src/Control-Applicative-Trans-Free.html#hoistApF" class="link">Source</a> <a href="#v:hoistApF" class="selflink">#</a></p><div class="doc"><p>Given a natural transformation from <code>f</code> to <code>f'</code> this gives a monoidal natural transformation from <code>ApF f g</code> to <code>ApF f' g</code>.</p></div></div><div class="top"><p class="src"><a id="v:transApT" class="def">transApT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; (<span class="keyword">forall</span> a. g a -&gt; g' a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f g' b <a href="src/Control-Applicative-Trans-Free.html#transApT" class="link">Source</a> <a href="#v:transApT" class="selflink">#</a></p><div class="doc"><p>Given a natural transformation from <code>g</code> to <code>g'</code> this gives a monoidal natural transformation from <code>ApT f g</code> to <code>ApT f g'</code>.</p></div></div><div class="top"><p class="src"><a id="v:transApF" class="def">transApF</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> g =&gt; (<span class="keyword">forall</span> a. g a -&gt; g' a) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g b -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApF">ApF</a> f g' b <a href="src/Control-Applicative-Trans-Free.html#transApF" class="link">Source</a> <a href="#v:transApF" class="selflink">#</a></p><div class="doc"><p>Given a natural transformation from <code>g</code> to <code>g'</code> this gives a monoidal natural transformation from <code>ApF f g</code> to <code>ApF f g'</code>.</p></div></div><div class="top"><p class="src"><a id="v:joinApT" class="def">joinApT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f m a -&gt; m (<a href="Control-Applicative-Trans-Free.html#t:Ap">Ap</a> f a) <a href="src/Control-Applicative-Trans-Free.html#joinApT" class="link">Source</a> <a href="#v:joinApT" class="selflink">#</a></p><div class="doc"><p>Pull out and join <code>m</code> layers of <code><code><a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a></code> f m a</code>.</p></div></div><h1 id="g:1">Free Applicative</h1><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:Ap" class="def">Ap</a> f = <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor-Identity.html#t:Identity">Identity</a> <a href="src/Control-Applicative-Trans-Free.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.0.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.0.0/Data-Functor.html#t:Functor">Functor</a></code> <code>f</code>.</p></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.0.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-Trans-Free.html#t:Ap">Ap</a> f a -&gt; g a <a href="src/Control-Applicative-Trans-Free.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-Trans-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 id="v:runAp_" class="def">runAp_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> m =&gt; (<span class="keyword">forall</span> x. f x -&gt; m) -&gt; <a href="Control-Applicative-Trans-Free.html#t:Ap">Ap</a> f a -&gt; m <a href="src/Control-Applicative-Trans-Free.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 :: <code><a href="Control-Applicative-Trans-Free.html#t:Ap">Ap</a></code> f a -&gt; <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></code>
count = <code>getSum</code> . runAp_ (\_ -&gt; <code>Sum</code> 1)
</pre></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.0.0/Control-Applicative.html#t:Applicative">Applicative</a> f =&gt; <a href="Control-Applicative-Trans-Free.html#t:Ap">Ap</a> f a -&gt; f a <a href="src/Control-Applicative-Trans-Free.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.0.0/Control-Applicative.html#v:pure">pure</a></code> and <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.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:2">Free Alternative</h1><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:Alt" class="def">Alt</a> f = <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f [] <a href="src/Control-Applicative-Trans-Free.html#Alt" class="link">Source</a> <a href="#t:Alt" class="selflink">#</a></p><div class="doc"><p>The free <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a></code> for a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a></code> <code>f</code>.</p></div></div><div class="top"><p class="src"><a id="v:runAlt" class="def">runAlt</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> g, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Foldable.html#t:Foldable">Foldable</a> t) =&gt; (<span class="keyword">forall</span> x. f x -&gt; g x) -&gt; <a href="Control-Applicative-Trans-Free.html#t:ApT">ApT</a> f t a -&gt; g a <a href="src/Control-Applicative-Trans-Free.html#runAlt" class="link">Source</a> <a href="#v:runAlt" 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-Trans-Free.html#t:Alt">Alt</a></code> f</code> to <code>g</code>.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>