This file is indexed.

/usr/share/doc/libghc-generics-sop-doc/html/Generics-SOP-Classes.html is in libghc-generics-sop-doc 0.2.0.0-1.

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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!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>Generics.SOP.Classes</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_Generics-SOP-Classes.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Generics-SOP-Classes.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">generics-sop-0.2.0.0: Generic Programming using True Sums of Products</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Generics.SOP.Classes</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Classes for generalized combinators on SOP types.</p><p>In the SOP approach to generic programming, we're predominantly
 concerned with four structured datatypes:</p><pre>  <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  :: (k -&gt; *) -&gt; ( [k]  -&gt; *)   -- n-ary product
  <code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  :: (k -&gt; *) -&gt; ( [k]  -&gt; *)   -- n-ary sum
  <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> :: (k -&gt; *) -&gt; ([[k]] -&gt; *)   -- product of products
  <code><a href="Generics-SOP-NS.html#v:SOP">SOP</a></code> :: (k -&gt; *) -&gt; ([[k]] -&gt; *)   -- sum of products
</pre><p>All of these have a kind that fits the following pattern:</p><pre>  (k -&gt; *) -&gt; (l -&gt; *)
</pre><p>These four types support similar interfaces. In order to allow
 reusing the same combinator names for all of these types, we define
 various classes in this module that allow the necessary
 generalization.</p><p>The classes typically lift concepts that exist for kinds <code>*</code> or
 <code>* -&gt; *</code> to datatypes of kind <code>(k -&gt; *) -&gt; (l -&gt; *)</code>. This module
 also derives a number of derived combinators.</p><p>The actual instances are defined in <a href="Generics-SOP-NP.html">Generics.SOP.NP</a> and
 <a href="Generics-SOP-NS.html">Generics.SOP.NS</a>.</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">class</span> <a href="#t:HPure">HPure</a> h <span class="keyword">where</span><ul class="subs"><li><a href="#v:hpure">hpure</a> :: <a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> h xs =&gt; (<span class="keyword">forall</span> a. f a) -&gt; h f xs</li><li><a href="#v:hcpure">hcpure</a> :: <a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> h c xs =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a) -&gt; h f xs</li></ul></li><li class="src short"><span class="keyword">newtype</span> (f <a href="#t:-45-.-45--62-">-.-&gt;</a> g) a = <a href="#v:Fn">Fn</a> {<ul class="subs"><li><a href="#v:apFn">apFn</a> :: f a -&gt; g a</li></ul>}</li><li class="src short"><a href="#v:fn">fn</a> :: (f a -&gt; f' a) -&gt; (f <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> f') a</li><li class="src short"><a href="#v:fn_2">fn_2</a> :: (f a -&gt; f' a -&gt; f'' a) -&gt; (f <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> f'')) a</li><li class="src short"><a href="#v:fn_3">fn_3</a> :: (f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; (f <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f'' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> f'''))) a</li><li class="src short"><a href="#v:fn_4">fn_4</a> :: (f a -&gt; f' a -&gt; f'' a -&gt; f''' a -&gt; f'''' a) -&gt; (f <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f'' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f''' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> f'''')))) a</li><li class="src short"><span class="keyword">type family</span> <a href="#t:Prod">Prod</a> h :: (k -&gt; *) -&gt; l -&gt; *</li><li class="src short"><span class="keyword">class</span> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) ~ <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h, <a href="Generics-SOP-Classes.html#t:HPure">HPure</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; <a href="#t:HAp">HAp</a> h <span class="keyword">where</span><ul class="subs"><li><a href="#v:hap">hap</a> :: <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h (f <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> g) xs -&gt; h f xs -&gt; h g xs</li></ul></li><li class="src short"><a href="#v:hliftA">hliftA</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a) -&gt; h f xs -&gt; h f' xs</li><li class="src short"><a href="#v:hliftA2">hliftA2</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a -&gt; f'' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; h f' xs -&gt; h f'' xs</li><li class="src short"><a href="#v:hliftA3">hliftA3</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f' xs -&gt; h f'' xs -&gt; h f''' xs</li><li class="src short"><a href="#v:hmap">hmap</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a) -&gt; h f xs -&gt; h f' xs</li><li class="src short"><a href="#v:hzipWith">hzipWith</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a -&gt; f'' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; h f' xs -&gt; h f'' xs</li><li class="src short"><a href="#v:hzipWith3">hzipWith3</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f' xs -&gt; h f'' xs -&gt; h f''' xs</li><li class="src short"><a href="#v:hcliftA">hcliftA</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a) -&gt; h f xs -&gt; h f' xs</li><li class="src short"><a href="#v:hcliftA2">hcliftA2</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a -&gt; f'' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; h f' xs -&gt; h f'' xs</li><li class="src short"><a href="#v:hcliftA3">hcliftA3</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f' xs -&gt; h f'' xs -&gt; h f''' xs</li><li class="src short"><a href="#v:hcmap">hcmap</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a) -&gt; h f xs -&gt; h f' xs</li><li class="src short"><a href="#v:hczipWith">hczipWith</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a -&gt; f'' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; h f' xs -&gt; h f'' xs</li><li class="src short"><a href="#v:hczipWith3">hczipWith3</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f' xs -&gt; h f'' xs -&gt; h f''' xs</li><li class="src short"><span class="keyword">type family</span> <a href="#t:CollapseTo">CollapseTo</a> h x :: *</li><li class="src short"><span class="keyword">class</span> <a href="#t:HCollapse">HCollapse</a> h <span class="keyword">where</span><ul class="subs"><li><a href="#v:hcollapse">hcollapse</a> :: <a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> h xs =&gt; h (<a href="Generics-SOP-BasicFunctors.html#t:K">K</a> a) xs -&gt; <a href="Generics-SOP-Classes.html#t:CollapseTo">CollapseTo</a> h a</li></ul></li><li class="src short"><span class="keyword">class</span> <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h =&gt; <a href="#t:HSequence">HSequence</a> h <span class="keyword">where</span><ul class="subs"><li><a href="#v:hsequence-39-">hsequence'</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> h xs, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f) =&gt; h (f <a href="Generics-SOP-BasicFunctors.html#t::.:">:.:</a> g) xs -&gt; f (h g xs)</li></ul></li><li class="src short"><a href="#v:hsequence">hsequence</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> h xs, <a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HSequence">HSequence</a> h) =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f =&gt; h f xs -&gt; f (h <a href="Generics-SOP-BasicFunctors.html#t:I">I</a> xs)</li><li class="src short"><a href="#v:hsequenceK">hsequenceK</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> h xs, <a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <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="Generics-SOP-Classes.html#t:HSequence">HSequence</a> h) =&gt; h (<a href="Generics-SOP-BasicFunctors.html#t:K">K</a> (f a)) xs -&gt; f (h (<a href="Generics-SOP-BasicFunctors.html#t:K">K</a> a) xs)</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:HPure" class="def">HPure</a> h <span class="keyword">where</span> <a href="src/Generics-SOP-Classes.html#HPure" class="link">Source</a></p><div class="doc"><p>A generalization of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:pure">pure</a></code> or
 <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#v:return">return</a></code> to higher kinds.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:hpure" class="def">hpure</a> :: <a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> h xs =&gt; (<span class="keyword">forall</span> a. f a) -&gt; h f xs <a href="src/Generics-SOP-Classes.html#hpure" class="link">Source</a></p><div class="doc"><p>Corresponds to <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:pure">pure</a></code> directly.</p><p><em>Instances:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hpure">hpure</a></code>, <code><a href="Generics-SOP-NP.html#v:pure_NP">pure_NP</a></code>  :: <code>SListI</code>  xs  =&gt; (forall a. f a) -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f xs
<code><a href="Generics-SOP-Classes.html#v:hpure">hpure</a></code>, <code><a href="Generics-SOP-NP.html#v:pure_POP">pure_POP</a></code> :: <code><a href="Generics-SOP-Constraint.html#t:SListI2">SListI2</a></code> xss =&gt; (forall a. f a) -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f xss
</pre></div><p class="src"><a name="v:hcpure" class="def">hcpure</a> :: <a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> h c xs =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a) -&gt; h f xs <a href="src/Generics-SOP-Classes.html#hcpure" class="link">Source</a></p><div class="doc"><p>A variant of <code><a href="Generics-SOP-Classes.html#v:hpure">hpure</a></code> that allows passing in a constrained
 argument.</p><p>Calling <code><code><a href="Generics-SOP-Classes.html#v:hcpure">hcpure</a></code> f s</code> where <code>s :: h f xs</code> causes <code>f</code> to be
 applied at all the types that are contained in <code>xs</code>. Therefore,
 the constraint <code>c</code> has to be satisfied for all elements of <code>xs</code>,
 which is what <code><code>AllMap</code> h c xs</code> states.</p><p>Morally, <code><a href="Generics-SOP-Classes.html#v:hpure">hpure</a></code> is a special case of <code><a href="Generics-SOP-Classes.html#v:hcpure">hcpure</a></code> where the
 constraint is empty. However, it is in the nature of how <code>AllMap</code>
 is defined as well as current GHC limitations that it is tricky
 to prove to GHC in general that <code><code>AllMap</code> h c NoConstraint xs</code> is
 always satisfied. Therefore, we typically define <code><a href="Generics-SOP-Classes.html#v:hpure">hpure</a></code>
 separately and directly, and make it a member of the class.</p><p><em>Instances:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hcpure">hcpure</a></code>, <code><a href="Generics-SOP-NP.html#v:cpure_NP">cpure_NP</a></code>  :: (<code><a href="Generics-SOP-Constraint.html#t:All">All</a></code>  c xs ) =&gt; proxy c -&gt; (forall a. c a =&gt; f a) -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f xs
<code><a href="Generics-SOP-Classes.html#v:hcpure">hcpure</a></code>, <code><a href="Generics-SOP-NP.html#v:cpure_POP">cpure_POP</a></code> :: (<code><a href="Generics-SOP-Constraint.html#t:All2">All2</a></code> c xss) =&gt; proxy c -&gt; (forall a. c a =&gt; f a) -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f xss
</pre></div></div><div class="subs instances"><p id="control.i:HPure" class="caption collapser" onclick="toggleSection('i:HPure')">Instances</p><div id="section.i:HPure" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HPure">HPure</a> k [[k]] (<a href="Generics-SOP-NP.html#t:POP">POP</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-193" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HPure">HPure</a> k [k] (<a href="Generics-SOP-NP.html#t:NP">NP</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-189" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> (f <a name="t:-45-.-45--62-" class="def">-.-&gt;</a> g) a <span class="fixity">infixr 1</span><span class="rightedge"></span> <a href="src/Generics-SOP-Classes.html#-.-%3E" class="link">Source</a></p><div class="doc"><p>Lifted functions.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Fn" class="def">Fn</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:apFn" class="def">apFn</a> :: f a -&gt; g a</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr></table></div></div><div class="top"><p class="src"><a name="v:fn" class="def">fn</a> :: (f a -&gt; f' a) -&gt; (f <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> f') a <a href="src/Generics-SOP-Classes.html#fn" class="link">Source</a></p><div class="doc"><p>Construct a lifted function.</p><p>Same as <code><a href="Generics-SOP-Classes.html#v:Fn">Fn</a></code>. Only available for uniformity with the
 higher-arity versions.</p></div></div><div class="top"><p class="src"><a name="v:fn_2" class="def">fn_2</a> :: (f a -&gt; f' a -&gt; f'' a) -&gt; (f <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> f'')) a <a href="src/Generics-SOP-Classes.html#fn_2" class="link">Source</a></p><div class="doc"><p>Construct a binary lifted function.</p></div></div><div class="top"><p class="src"><a name="v:fn_3" class="def">fn_3</a> :: (f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; (f <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f'' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> f'''))) a <a href="src/Generics-SOP-Classes.html#fn_3" class="link">Source</a></p><div class="doc"><p>Construct a ternary lifted function.</p></div></div><div class="top"><p class="src"><a name="v:fn_4" class="def">fn_4</a> :: (f a -&gt; f' a -&gt; f'' a -&gt; f''' a -&gt; f'''' a) -&gt; (f <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f'' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> (f''' <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> f'''')))) a <a href="src/Generics-SOP-Classes.html#fn_4" class="link">Source</a></p><div class="doc"><p>Construct a quarternary lifted function.</p></div></div><div class="top"><p class="src"><span class="keyword">type family</span> <a name="t:Prod" class="def">Prod</a> h :: (k -&gt; *) -&gt; l -&gt; * <a href="src/Generics-SOP-Classes.html#Prod" class="link">Source</a></p><div class="doc"><p>Maps a structure containing sums to the corresponding
 product structure.</p></div><div class="subs instances"><p id="control.i:Prod" class="caption collapser" onclick="toggleSection('i:Prod')">Instances</p><div id="section.i:Prod" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> k [[k]] (<a href="Generics-SOP-NP.html#t:POP">POP</a> k) = <a href="Generics-SOP-NP.html#t:POP">POP</a> k</span> <a href="src/Generics-SOP-Classes.html#line-244" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> k [k] (<a href="Generics-SOP-NP.html#t:NP">NP</a> k) = <a href="Generics-SOP-NP.html#t:NP">NP</a> k</span> <a href="src/Generics-SOP-Classes.html#line-243" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> k [[k]] (<a href="Generics-SOP-NS.html#t:SOP">SOP</a> k) = <a href="Generics-SOP-NP.html#t:POP">POP</a> k</span> <a href="src/Generics-SOP-Classes.html#line-208" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> k [k] (<a href="Generics-SOP-NS.html#t:NS">NS</a> k) = <a href="Generics-SOP-NP.html#t:NP">NP</a> k</span> <a href="src/Generics-SOP-Classes.html#line-207" class="link">Source</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="Generics-SOP-Classes.html#t:Prod">Prod</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) ~ <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h, <a href="Generics-SOP-Classes.html#t:HPure">HPure</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; <a name="t:HAp" class="def">HAp</a> h <span class="keyword">where</span> <a href="src/Generics-SOP-Classes.html#HAp" class="link">Source</a></p><div class="doc"><p>A generalization of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:-60--42--62-">&lt;*&gt;</a></code>.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:hap" class="def">hap</a> :: <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h (f <a href="Generics-SOP-Classes.html#t:-45-.-45--62-">-.-&gt;</a> g) xs -&gt; h f xs -&gt; h g xs <a href="src/Generics-SOP-Classes.html#hap" class="link">Source</a></p><div class="doc"><p>Corresponds to <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:-60--42--62-">&lt;*&gt;</a></code>.</p><p>For products (<code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>) as well as products of products
 ('Generics.SOP.NP.POP), the correspondence is rather direct. We combine
 a structure containing (lifted) functions and a compatible structure
 containing corresponding arguments into a compatible structure
 containing results.</p><p>The same combinator can also be used to combine a product
 structure of functions with a sum structure of arguments, which then
 results in another sum structure of results. The sum structure
 determines which part of the product structure will be used.</p><p><em>Instances:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code>, <code><a href="Generics-SOP-NP.html#v:ap_NP">ap_NP</a></code>  :: <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  (f -.-&gt; g) xs  -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f xs  -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  g xs
<code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code>, <code><a href="Generics-SOP-NS.html#v:ap_NS">ap_NS</a></code>  :: <code><a href="Generics-SOP-NS.html#v:NP">NP</a></code>  (f -.-&gt; g) xs  -&gt; <code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  f xs  -&gt; <code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  g xs
<code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code>, <code><a href="Generics-SOP-NP.html#v:ap_POP">ap_POP</a></code> :: <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> (f -.-&gt; g) xss -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f xss -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> g xss
<code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code>, <code><a href="Generics-SOP-NS.html#v:ap_SOP">ap_SOP</a></code> :: <code><a href="Generics-SOP-NS.html#v:POP">POP</a></code> (f -.-&gt; g) xss -&gt; <code><a href="Generics-SOP-NS.html#v:SOP">SOP</a></code> f xss -&gt; <code><a href="Generics-SOP-NS.html#v:SOP">SOP</a></code> g xss
</pre></div></div><div class="subs instances"><p id="control.i:HAp" class="caption collapser" onclick="toggleSection('i:HAp')">Instances</p><div id="section.i:HAp" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HAp">HAp</a> k [[k]] (<a href="Generics-SOP-NP.html#t:POP">POP</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-247" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HAp">HAp</a> k [k] (<a href="Generics-SOP-NP.html#t:NP">NP</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-246" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HAp">HAp</a> k [[k]] (<a href="Generics-SOP-NS.html#t:SOP">SOP</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-214" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HAp">HAp</a> k [k] (<a href="Generics-SOP-NS.html#t:NS">NS</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-213" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:hliftA" class="def">hliftA</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a) -&gt; h f xs -&gt; h f' xs <a href="src/Generics-SOP-Classes.html#hliftA" class="link">Source</a></p><div class="doc"><p>A generalized form of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:liftA">liftA</a></code>,
 which in turn is a generalized <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-OldList.html#v:map">map</a></code>.</p><p>Takes a lifted function and applies it to every element of
 a structure while preserving its shape.</p><p><em>Specification:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hliftA">hliftA</a></code> f xs = <code><a href="Generics-SOP-Classes.html#v:hpure">hpure</a></code> (<code><a href="Generics-SOP-Classes.html#v:fn">fn</a></code> f) ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` xs
</pre><p><em>Instances:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hliftA">hliftA</a></code>, <code><a href="Generics-SOP-NP.html#v:liftA_NP">liftA_NP</a></code>  :: <code>SListI</code>  xs  =&gt; (forall a. f a -&gt; f' a) -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f xs  -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f' xs
<code><a href="Generics-SOP-Classes.html#v:hliftA">hliftA</a></code>, <code><a href="Generics-SOP-NS.html#v:liftA_NS">liftA_NS</a></code>  :: <code>SListI</code>  xs  =&gt; (forall a. f a -&gt; f' a) -&gt; <code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  f xs  -&gt; <code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  f' xs
<code><a href="Generics-SOP-Classes.html#v:hliftA">hliftA</a></code>, <code><a href="Generics-SOP-NP.html#v:liftA_POP">liftA_POP</a></code> :: <code><a href="Generics-SOP-Constraint.html#t:SListI2">SListI2</a></code> xss =&gt; (forall a. f a -&gt; f' a) -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f xss -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f' xss
<code><a href="Generics-SOP-Classes.html#v:hliftA">hliftA</a></code>, <code><a href="Generics-SOP-NS.html#v:liftA_SOP">liftA_SOP</a></code> :: <code><a href="Generics-SOP-Constraint.html#t:SListI2">SListI2</a></code> xss =&gt; (forall a. f a -&gt; f' a) -&gt; <code><a href="Generics-SOP-NS.html#v:SOP">SOP</a></code> f xss -&gt; <code><a href="Generics-SOP-NS.html#v:SOP">SOP</a></code> f' xss
</pre></div></div><div class="top"><p class="src"><a name="v:hliftA2" class="def">hliftA2</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a -&gt; f'' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; h f' xs -&gt; h f'' xs <a href="src/Generics-SOP-Classes.html#hliftA2" class="link">Source</a></p><div class="doc"><p>A generalized form of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:liftA2">liftA2</a></code>,
 which in turn is a generalized <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-OldList.html#v:zipWith">zipWith</a></code>.</p><p>Takes a lifted binary function and uses it to combine two
 structures of equal shape into a single structure.</p><p>It either takes two product structures to a product structure,
 or one product and one sum structure to a sum structure.</p><p><em>Specification:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hliftA2">hliftA2</a></code> f xs ys = <code><a href="Generics-SOP-Classes.html#v:hpure">hpure</a></code> (<code><a href="Generics-SOP-Classes.html#v:fn_2">fn_2</a></code> f) ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` xs ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` ys
</pre><p><em>Instances:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hliftA2">hliftA2</a></code>, <code><a href="Generics-SOP-NP.html#v:liftA2_NP">liftA2_NP</a></code>  :: <code>SListI</code>  xs  =&gt; (forall a. f a -&gt; f' a -&gt; f'' a) -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f xs  -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f' xs  -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f'' xs
<code><a href="Generics-SOP-Classes.html#v:hliftA2">hliftA2</a></code>, <code><a href="Generics-SOP-NS.html#v:liftA2_NS">liftA2_NS</a></code>  :: <code>SListI</code>  xs  =&gt; (forall a. f a -&gt; f' a -&gt; f'' a) -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f xs  -&gt; <code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  f' xs  -&gt; <code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  f'' xs
<code><a href="Generics-SOP-Classes.html#v:hliftA2">hliftA2</a></code>, <code><a href="Generics-SOP-NP.html#v:liftA2_POP">liftA2_POP</a></code> :: <code><a href="Generics-SOP-Constraint.html#t:SListI2">SListI2</a></code> xss =&gt; (forall a. f a -&gt; f' a -&gt; f'' a) -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f xss -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f' xss -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f'' xss
<code><a href="Generics-SOP-Classes.html#v:hliftA2">hliftA2</a></code>, <code><a href="Generics-SOP-NS.html#v:liftA2_SOP">liftA2_SOP</a></code> :: <code><a href="Generics-SOP-Constraint.html#t:SListI2">SListI2</a></code> xss =&gt; (forall a. f a -&gt; f' a -&gt; f'' a) -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f xss -&gt; <code><a href="Generics-SOP-NS.html#v:SOP">SOP</a></code> f' xss -&gt; <code><a href="Generics-SOP-NS.html#v:SOP">SOP</a></code> f'' xss
</pre></div></div><div class="top"><p class="src"><a name="v:hliftA3" class="def">hliftA3</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f' xs -&gt; h f'' xs -&gt; h f''' xs <a href="src/Generics-SOP-Classes.html#hliftA3" class="link">Source</a></p><div class="doc"><p>A generalized form of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#v:liftA3">liftA3</a></code>,
 which in turn is a generalized <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/GHC-OldList.html#v:zipWith3">zipWith3</a></code>.</p><p>Takes a lifted ternary function and uses it to combine three
 structures of equal shape into a single structure.</p><p>It either takes three product structures to a product structure,
 or two product structures and one sum structure to a sum structure.</p><p><em>Specification:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hliftA3">hliftA3</a></code> f xs ys zs = <code><a href="Generics-SOP-Classes.html#v:hpure">hpure</a></code> (<code><a href="Generics-SOP-Classes.html#v:fn_3">fn_3</a></code> f) ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` xs ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` ys ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` zs
</pre><p><em>Instances:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hliftA3">hliftA3</a></code>, <code><a href="Generics-SOP-NP.html#v:liftA3_NP">liftA3_NP</a></code>  :: <code>SListI</code>  xs  =&gt; (forall a. f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f xs  -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f' xs  -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f'' xs  -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f''' xs
<code><a href="Generics-SOP-Classes.html#v:hliftA3">hliftA3</a></code>, <code><a href="Generics-SOP-NS.html#v:liftA3_NS">liftA3_NS</a></code>  :: <code>SListI</code>  xs  =&gt; (forall a. f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f xs  -&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  f' xs  -&gt; <code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  f'' xs  -&gt; <code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  f''' xs
<code><a href="Generics-SOP-Classes.html#v:hliftA3">hliftA3</a></code>, <code><a href="Generics-SOP-NP.html#v:liftA3_POP">liftA3_POP</a></code> :: <code><a href="Generics-SOP-Constraint.html#t:SListI2">SListI2</a></code> xss =&gt; (forall a. f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f xss -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f' xss -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f'' xss -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f''' xs
<code><a href="Generics-SOP-Classes.html#v:hliftA3">hliftA3</a></code>, <code><a href="Generics-SOP-NS.html#v:liftA3_SOP">liftA3_SOP</a></code> :: <code><a href="Generics-SOP-Constraint.html#t:SListI2">SListI2</a></code> xss =&gt; (forall a. f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f xss -&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> f' xss -&gt; <code><a href="Generics-SOP-NS.html#v:SOP">SOP</a></code> f'' xss -&gt; <code><a href="Generics-SOP-NP.html#v:SOP">SOP</a></code> f''' xs
</pre></div></div><div class="top"><p class="src"><a name="v:hmap" class="def">hmap</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a) -&gt; h f xs -&gt; h f' xs <a href="src/Generics-SOP-Classes.html#hmap" class="link">Source</a></p><div class="doc"><p>Another name for <code><a href="Generics-SOP-Classes.html#v:hliftA">hliftA</a></code>.</p></div></div><div class="top"><p class="src"><a name="v:hzipWith" class="def">hzipWith</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a -&gt; f'' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; h f' xs -&gt; h f'' xs <a href="src/Generics-SOP-Classes.html#hzipWith" class="link">Source</a></p><div class="doc"><p>Another name for <code><a href="Generics-SOP-Classes.html#v:hliftA2">hliftA2</a></code>.</p></div></div><div class="top"><p class="src"><a name="v:hzipWith3" class="def">hzipWith3</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; (<span class="keyword">forall</span> a. f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f' xs -&gt; h f'' xs -&gt; h f''' xs <a href="src/Generics-SOP-Classes.html#hzipWith3" class="link">Source</a></p><div class="doc"><p>Another name for <code><a href="Generics-SOP-Classes.html#v:hliftA3">hliftA3</a></code>.</p></div></div><div class="top"><p class="src"><a name="v:hcliftA" class="def">hcliftA</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a) -&gt; h f xs -&gt; h f' xs <a href="src/Generics-SOP-Classes.html#hcliftA" class="link">Source</a></p><div class="doc"><p>Variant of <code><a href="Generics-SOP-Classes.html#v:hliftA">hliftA</a></code> that takes a constrained function.</p><p><em>Specification:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hcliftA">hcliftA</a></code> p f xs = <code><a href="Generics-SOP-Classes.html#v:hcpure">hcpure</a></code> p (<code><a href="Generics-SOP-Classes.html#v:fn">fn</a></code> f) ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` xs
</pre></div></div><div class="top"><p class="src"><a name="v:hcliftA2" class="def">hcliftA2</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a -&gt; f'' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; h f' xs -&gt; h f'' xs <a href="src/Generics-SOP-Classes.html#hcliftA2" class="link">Source</a></p><div class="doc"><p>Variant of <code><a href="Generics-SOP-Classes.html#v:hcliftA2">hcliftA2</a></code> that takes a constrained function.</p><p><em>Specification:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hcliftA2">hcliftA2</a></code> p f xs ys = <code><a href="Generics-SOP-Classes.html#v:hcpure">hcpure</a></code> p (<code><a href="Generics-SOP-Classes.html#v:fn_2">fn_2</a></code> f) ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` xs ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` ys
</pre></div></div><div class="top"><p class="src"><a name="v:hcliftA3" class="def">hcliftA3</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f' xs -&gt; h f'' xs -&gt; h f''' xs <a href="src/Generics-SOP-Classes.html#hcliftA3" class="link">Source</a></p><div class="doc"><p>Variant of <code><a href="Generics-SOP-Classes.html#v:hcliftA3">hcliftA3</a></code> that takes a constrained function.</p><p><em>Specification:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hcliftA3">hcliftA3</a></code> p f xs ys zs = <code><a href="Generics-SOP-Classes.html#v:hcpure">hcpure</a></code> p (<code><a href="Generics-SOP-Classes.html#v:fn_3">fn_3</a></code> f) ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` xs ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` ys ` <code><a href="Generics-SOP-Classes.html#v:hap">hap</a></code> ` zs
</pre></div></div><div class="top"><p class="src"><a name="v:hcmap" class="def">hcmap</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a) -&gt; h f xs -&gt; h f' xs <a href="src/Generics-SOP-Classes.html#hcmap" class="link">Source</a></p><div class="doc"><p>Another name for <code><a href="Generics-SOP-Classes.html#v:hcliftA">hcliftA</a></code>.</p></div></div><div class="top"><p class="src"><a name="v:hczipWith" class="def">hczipWith</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a -&gt; f'' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; h f' xs -&gt; h f'' xs <a href="src/Generics-SOP-Classes.html#hczipWith" class="link">Source</a></p><div class="doc"><p>Another name for <code><a href="Generics-SOP-Classes.html#v:hcliftA2">hcliftA2</a></code>.</p></div></div><div class="top"><p class="src"><a name="v:hczipWith3" class="def">hczipWith3</a> :: (<a href="Generics-SOP-Constraint.html#t:AllN">AllN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) c xs, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> h, <a href="Generics-SOP-Classes.html#t:HAp">HAp</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h)) =&gt; proxy c -&gt; (<span class="keyword">forall</span> a. c a =&gt; f a -&gt; f' a -&gt; f'' a -&gt; f''' a) -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f xs -&gt; <a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h f' xs -&gt; h f'' xs -&gt; h f''' xs <a href="src/Generics-SOP-Classes.html#hczipWith3" class="link">Source</a></p><div class="doc"><p>Another name for <code><a href="Generics-SOP-Classes.html#v:hcliftA3">hcliftA3</a></code>.</p></div></div><div class="top"><p class="src"><span class="keyword">type family</span> <a name="t:CollapseTo" class="def">CollapseTo</a> h x :: * <a href="src/Generics-SOP-Classes.html#CollapseTo" class="link">Source</a></p><div class="doc"><p>Maps products to lists, and sums to identities.</p></div><div class="subs instances"><p id="control.i:CollapseTo" class="caption collapser" onclick="toggleSection('i:CollapseTo')">Instances</p><div id="section.i:CollapseTo" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Generics-SOP-Classes.html#t:CollapseTo">CollapseTo</a> k [[k]] (<a href="Generics-SOP-NP.html#t:POP">POP</a> k) a = [[a]]</span> <a href="src/Generics-SOP-Classes.html#line-416" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Generics-SOP-Classes.html#t:CollapseTo">CollapseTo</a> k [k] (<a href="Generics-SOP-NP.html#t:NP">NP</a> k) a = [a]</span> <a href="src/Generics-SOP-Classes.html#line-415" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Generics-SOP-Classes.html#t:CollapseTo">CollapseTo</a> k [[k]] (<a href="Generics-SOP-NS.html#t:SOP">SOP</a> k) a = [a]</span> <a href="src/Generics-SOP-Classes.html#line-287" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><span class="keyword">type</span> <a href="Generics-SOP-Classes.html#t:CollapseTo">CollapseTo</a> k [k] (<a href="Generics-SOP-NS.html#t:NS">NS</a> k) a = a</span> <a href="src/Generics-SOP-Classes.html#line-286" class="link">Source</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 name="t:HCollapse" class="def">HCollapse</a> h <span class="keyword">where</span> <a href="src/Generics-SOP-Classes.html#HCollapse" class="link">Source</a></p><div class="doc"><p>A class for collapsing a heterogeneous structure into
 a homogeneous one.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:hcollapse" class="def">hcollapse</a> :: <a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> h xs =&gt; h (<a href="Generics-SOP-BasicFunctors.html#t:K">K</a> a) xs -&gt; <a href="Generics-SOP-Classes.html#t:CollapseTo">CollapseTo</a> h a <a href="src/Generics-SOP-Classes.html#hcollapse" class="link">Source</a></p><div class="doc"><p>Collapse a heterogeneous structure with homogeneous elements
 into a homogeneous structure.</p><p>If a heterogeneous structure is instantiated to the constant
 functor <code><a href="Generics-SOP-BasicFunctors.html#t:K">K</a></code>, then it is in fact homogeneous. This function
 maps such a value to a simpler Haskell datatype reflecting that.
 An <code><code>NS</code> (<code><a href="Generics-SOP-BasicFunctors.html#t:K">K</a></code> a)</code> contains a single <code>a</code>, and an <code><code>NP</code> (<code><a href="Generics-SOP-BasicFunctors.html#t:K">K</a></code> a)</code> contains
 a list of <code>a</code>s.</p><p><em>Instances:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hcollapse">hcollapse</a></code>, <code><a href="Generics-SOP-NP.html#v:collapse_NP">collapse_NP</a></code>  :: <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  (<code><a href="Generics-SOP-BasicFunctors.html#t:K">K</a></code> a) xs  -&gt;  [a]
<code><a href="Generics-SOP-Classes.html#v:hcollapse">hcollapse</a></code>, <code><a href="Generics-SOP-NS.html#v:collapse_NS">collapse_NS</a></code>  :: <code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  (<code><a href="Generics-SOP-BasicFunctors.html#t:K">K</a></code> a) xs  -&gt;   a
<code><a href="Generics-SOP-Classes.html#v:hcollapse">hcollapse</a></code>, <code><a href="Generics-SOP-NP.html#v:collapse_POP">collapse_POP</a></code> :: <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> (<code><a href="Generics-SOP-BasicFunctors.html#t:K">K</a></code> a) xss -&gt; [[a]]
<code><a href="Generics-SOP-Classes.html#v:hcollapse">hcollapse</a></code>, <code><a href="Generics-SOP-NS.html#v:collapse_SOP">collapse_SOP</a></code> :: <code><a href="Generics-SOP-NP.html#v:SOP">SOP</a></code> (<code><a href="Generics-SOP-BasicFunctors.html#t:K">K</a></code> a) xss -&gt;  [a]
</pre></div></div><div class="subs instances"><p id="control.i:HCollapse" class="caption collapser" onclick="toggleSection('i:HCollapse')">Instances</p><div id="section.i:HCollapse" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HCollapse">HCollapse</a> k [[k]] (<a href="Generics-SOP-NP.html#t:POP">POP</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-419" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HCollapse">HCollapse</a> k [k] (<a href="Generics-SOP-NP.html#t:NP">NP</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-418" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HCollapse">HCollapse</a> k [[k]] (<a href="Generics-SOP-NS.html#t:SOP">SOP</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-290" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HCollapse">HCollapse</a> k [k] (<a href="Generics-SOP-NS.html#t:NS">NS</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-289" class="link">Source</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="Generics-SOP-Classes.html#t:HAp">HAp</a> h =&gt; <a name="t:HSequence" class="def">HSequence</a> h <span class="keyword">where</span> <a href="src/Generics-SOP-Classes.html#HSequence" class="link">Source</a></p><div class="doc"><p>A generalization of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Traversable.html#v:sequenceA">sequenceA</a></code>.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:hsequence-39-" class="def">hsequence'</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> h xs, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f) =&gt; h (f <a href="Generics-SOP-BasicFunctors.html#t::.:">:.:</a> g) xs -&gt; f (h g xs) <a href="src/Generics-SOP-Classes.html#hsequence%27" class="link">Source</a></p><div class="doc"><p>Corresponds to <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Traversable.html#v:sequenceA">sequenceA</a></code>.</p><p>Lifts an applicative functor out of a structure.</p><p><em>Instances:</em></p><pre><code><a href="Generics-SOP-Classes.html#v:hsequence-39-">hsequence'</a></code>, <code><a href="Generics-SOP-NP.html#v:sequence-39-_NP">sequence'_NP</a></code>  :: (<code>SListI</code>  xs , <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a></code> f) =&gt; <code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  (f <code><a href="Generics-SOP-BasicFunctors.html#t::.:">:.:</a></code> g) xs  -&gt; f (<code><a href="Generics-SOP-NP.html#v:NP">NP</a></code>  g xs )
<code><a href="Generics-SOP-Classes.html#v:hsequence-39-">hsequence'</a></code>, <code><a href="Generics-SOP-NS.html#v:sequence-39-_NS">sequence'_NS</a></code>  :: (<code>SListI</code>  xs , <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a></code> f) =&gt; <code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  (f <code><a href="Generics-SOP-BasicFunctors.html#t::.:">:.:</a></code> g) xs  -&gt; f (<code><a href="Generics-SOP-NS.html#v:NS">NS</a></code>  g xs )
<code><a href="Generics-SOP-Classes.html#v:hsequence-39-">hsequence'</a></code>, <code><a href="Generics-SOP-NP.html#v:sequence-39-_POP">sequence'_POP</a></code> :: (<code><a href="Generics-SOP-Constraint.html#t:SListI2">SListI2</a></code> xss, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a></code> f) =&gt; <code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> (f <code><a href="Generics-SOP-BasicFunctors.html#t::.:">:.:</a></code> g) xss -&gt; f (<code><a href="Generics-SOP-NP.html#v:POP">POP</a></code> g xss)
<code><a href="Generics-SOP-Classes.html#v:hsequence-39-">hsequence'</a></code>, <code><a href="Generics-SOP-NS.html#v:sequence-39-_SOP">sequence'_SOP</a></code> :: (<code><a href="Generics-SOP-Constraint.html#t:SListI2">SListI2</a></code> xss, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a></code> f) =&gt; <code><a href="Generics-SOP-NS.html#v:SOP">SOP</a></code> (f <code><a href="Generics-SOP-BasicFunctors.html#t::.:">:.:</a></code> g) xss -&gt; f (<code><a href="Generics-SOP-NS.html#v:SOP">SOP</a></code> g xss)
</pre></div></div><div class="subs instances"><p id="control.i:HSequence" class="caption collapser" onclick="toggleSection('i:HSequence')">Instances</p><div id="section.i:HSequence" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HSequence">HSequence</a> k [[k]] (<a href="Generics-SOP-NP.html#t:POP">POP</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-435" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HSequence">HSequence</a> k [k] (<a href="Generics-SOP-NP.html#t:NP">NP</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-434" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HSequence">HSequence</a> k [[k]] (<a href="Generics-SOP-NS.html#t:SOP">SOP</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-306" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="Generics-SOP-Classes.html#t:HSequence">HSequence</a> k [k] (<a href="Generics-SOP-NS.html#t:NS">NS</a> k)</span> <a href="src/Generics-SOP-Classes.html#line-305" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:hsequence" class="def">hsequence</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> h xs, <a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <a href="Generics-SOP-Classes.html#t:HSequence">HSequence</a> h) =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> f =&gt; h f xs -&gt; f (h <a href="Generics-SOP-BasicFunctors.html#t:I">I</a> xs) <a href="src/Generics-SOP-Classes.html#hsequence" class="link">Source</a></p><div class="doc"><p>Special case of <code><a href="Generics-SOP-Classes.html#v:hsequence-39-">hsequence'</a></code> where <code>g = <code><a href="Generics-SOP-BasicFunctors.html#t:I">I</a></code></code>.</p></div></div><div class="top"><p class="src"><a name="v:hsequenceK" class="def">hsequenceK</a> :: (<a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> h xs, <a href="Generics-SOP-Constraint.html#t:SListIN">SListIN</a> (<a href="Generics-SOP-Classes.html#t:Prod">Prod</a> h) xs, <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="Generics-SOP-Classes.html#t:HSequence">HSequence</a> h) =&gt; h (<a href="Generics-SOP-BasicFunctors.html#t:K">K</a> (f a)) xs -&gt; f (h (<a href="Generics-SOP-BasicFunctors.html#t:K">K</a> a) xs) <a href="src/Generics-SOP-Classes.html#hsequenceK" class="link">Source</a></p><div class="doc"><p>Special case of <code><a href="Generics-SOP-Classes.html#v:hsequence-39-">hsequence'</a></code> where <code>g = <code><a href="Generics-SOP-BasicFunctors.html#t:K">K</a></code> a</code>.</p></div></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>