Skip to content
This repository
Browse code

2.9 final docs

  • Loading branch information...
commit 0761b92f9ee8851df4910f7d6b6feec196eaa204 1 parent 2601e53
Edward Kmett authored
13 Control-Lens-Iso.html
@@ -11,9 +11,10 @@
11 11 from the Prelude or from Control.Category. However, if you compose them
12 12 with each other using (<code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Control-Category.html#v:.">.</a></code>) from the Prelude, they will be dumbed down to a
13 13 mere <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>.
14   -</p><pre> import Control.Category
15   - import Prelude hiding ((.),id)
16   -</pre><pre>type Iso a b c d = forall k f. (<code><a href="Control-Lens-Iso.html#t:Isomorphic">Isomorphic</a></code> k, <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Control-Monad.html#t:Functor">Functor</a></code> f) =&gt; <code><a href="Control-Lens-Type.html#t:Overloaded">Overloaded</a></code> k f a b c d</pre></div></div><div class="top"><p class="src"><a name="v:iso" class="def">iso</a> :: (<a href="Control-Lens-Iso.html#t:Isomorphic">Isomorphic</a> k, <a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Control-Monad.html#t:Functor">Functor</a> f) =&gt; (a -&gt; b) -&gt; (b -&gt; a) -&gt; k (b -&gt; f b) (a -&gt; f a)<a href="src/Control-Lens-Iso.html#iso" class="link">Source</a></p><div class="doc"><p>Build a simple isomorphism from a pair of inverse functions
  14 +</p><pre>
  15 + import Control.Category
  16 + import Prelude hiding ((<code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Prelude.html#t:.">.</a></code>),<code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Prelude.html#t:id">id</a></code>)
  17 +</pre><pre>type <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code> a b c d = forall k f. (<code><a href="Control-Lens-Iso.html#t:Isomorphic">Isomorphic</a></code> k, <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Control-Monad.html#t:Functor">Functor</a></code> f) =&gt; <code><a href="Control-Lens-Type.html#t:Overloaded">Overloaded</a></code> k f a b c d</pre></div></div><div class="top"><p class="src"><a name="v:iso" class="def">iso</a> :: (<a href="Control-Lens-Iso.html#t:Isomorphic">Isomorphic</a> k, <a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Control-Monad.html#t:Functor">Functor</a> f) =&gt; (a -&gt; b) -&gt; (b -&gt; a) -&gt; k (b -&gt; f b) (a -&gt; f a)<a href="src/Control-Lens-Iso.html#iso" class="link">Source</a></p><div class="doc"><p>Build a simple isomorphism from a pair of inverse functions
17 18 </p><pre>
18 19 <code><a href="Control-Lens-Getter.html#v:view">view</a></code> (<code><a href="Control-Lens-Iso.html#v:iso">iso</a></code> f g) &#8801; f
19 20 <code><a href="Control-Lens-Getter.html#v:view">view</a></code> (<code><a href="Control-Lens-Iso.html#v:from">from</a></code> (<code><a href="Control-Lens-Iso.html#v:iso">iso</a></code> f g)) &#8801; g
@@ -31,9 +32,9 @@
31 32 </code></strong>10
32 33 </pre></div></div><div class="top"><p class="src"><a name="v:auf" class="def">auf</a> :: <a href="Control-Lens-Type.html#t:Simple">Simple</a> <a href="Control-Lens-Iso.html#t:Iso">Iso</a> a b -&gt; ((d -&gt; b) -&gt; c -&gt; b) -&gt; (d -&gt; a) -&gt; c -&gt; a<a href="src/Control-Lens-Iso.html#auf" class="link">Source</a></p><div class="doc"><p>Based on <code>ala'</code> from Conor McBride's work on Epigram.
33 34 </p><p>Mnemonically, the German <em>auf</em> plays a similar role to <em>&#224; la</em>, and the combinator
34   - is <em>au</em> with an extra function argument.
  35 + is <code><a href="Control-Lens-Iso.html#v:ala">ala</a></code> with an extra function argument.
35 36 </p></div></div><div class="top"><p class="src"><a name="v:under" class="def">under</a> :: <a href="Control-Lens-Iso.html#t:Isomorphism">Isomorphism</a> (c -&gt; <a href="Control-Lens-Internal.html#t:Mutator">Mutator</a> d) (a -&gt; <a href="Control-Lens-Internal.html#t:Mutator">Mutator</a> b) -&gt; (a -&gt; b) -&gt; c -&gt; d<a href="src/Control-Lens-Iso.html#under" class="link">Source</a></p><div class="doc"><p>The opposite of working <code><a href="Control-Lens-Setter.html#v:over">over</a></code> a Setter is working <code><a href="Control-Lens-Iso.html#v:under">under</a></code> an Isomorphism.
36   -</p><pre><code><a href="Control-Lens-Iso.html#v:under">under</a></code> = <code><a href="Control-Lens-Setter.html#v:over">over</a></code> <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Control-Category.html#v:.">.</a></code> <code><a href="Control-Lens-Iso.html#v:from">from</a></code></pre><pre><code><a href="Control-Lens-Iso.html#v:under">under</a></code> :: Iso a b c d -&gt; (a -&gt; b) -&gt; (c -&gt; d)</pre></div></div><h1 id="g:2">Primitive isomorphisms
  37 +</p><pre><code><a href="Control-Lens-Iso.html#v:under">under</a></code> = <code><a href="Control-Lens-Setter.html#v:over">over</a></code> <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Control-Category.html#v:.">.</a></code> <code><a href="Control-Lens-Iso.html#v:from">from</a></code></pre><pre><code><a href="Control-Lens-Iso.html#v:under">under</a></code> :: <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code> a b c d -&gt; (a -&gt; b) -&gt; c -&gt; d</pre></div></div><h1 id="g:2">Primitive isomorphisms
37 38 </h1><div class="top"><p class="src"><a name="v:from" class="def">from</a> :: <a href="Control-Lens-Iso.html#t:Isomorphic">Isomorphic</a> k =&gt; <a href="Control-Lens-Iso.html#t:Isomorphism">Isomorphism</a> a b -&gt; k b a<a href="src/Control-Lens-Isomorphic.html#from" class="link">Source</a></p><div class="doc"><p>Invert an isomorphism.
38 39 </p><p>Note to compose an isomorphism and receive an isomorphism in turn you'll need to use
39 40 <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Control-Category.html#t:Category">Category</a></code>
@@ -64,4 +65,4 @@
64 65 </pre></div></div><h1 id="g:4">Storing Isomorphisms
65 66 </h1><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:ReifiedIso" class="def">ReifiedIso</a> a b c d <a href="src/Control-Lens-Iso.html#ReifiedIso" class="link">Source</a></p><div class="doc"><p>Useful for storing isomorphisms in containers.
66 67 </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ReifyIso" class="def">ReifyIso</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:reflectIso" class="def">reflectIso</a> :: <a href="Control-Lens-Iso.html#t:Iso">Iso</a> a b c d</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr></table></div></div><h1 id="g:5">Simplicity
67   -</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:SimpleIso" class="def">SimpleIso</a> a b = <a href="Control-Lens-Iso.html#t:Iso">Iso</a> a a b b<a href="src/Control-Lens-Iso.html#SimpleIso" class="link">Source</a></p><div class="doc"><pre>type SimpleIso = <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code></pre></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:SimpleReifiedIso" class="def">SimpleReifiedIso</a> a b = <a href="Control-Lens-Iso.html#t:ReifiedIso">ReifiedIso</a> a a b b<a href="src/Control-Lens-Iso.html#SimpleReifiedIso" class="link">Source</a></p><div class="doc"><pre>type SimpleReifiedIso = <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Iso.html#t:ReifiedIso">ReifiedIso</a></code></pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.12.0</p></div></body></html>
  68 +</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:SimpleIso" class="def">SimpleIso</a> a b = <a href="Control-Lens-Iso.html#t:Iso">Iso</a> a a b b<a href="src/Control-Lens-Iso.html#SimpleIso" class="link">Source</a></p><div class="doc"><pre>type <code><a href="Control-Lens-Iso.html#t:SimpleIso">SimpleIso</a></code> = <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code></pre></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:SimpleReifiedIso" class="def">SimpleReifiedIso</a> a b = <a href="Control-Lens-Iso.html#t:ReifiedIso">ReifiedIso</a> a a b b<a href="src/Control-Lens-Iso.html#SimpleReifiedIso" class="link">Source</a></p><div class="doc"><pre>type <code><a href="Control-Lens-Iso.html#t:SimpleReifiedIso">SimpleReifiedIso</a></code> = <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Iso.html#t:ReifiedIso">ReifiedIso</a></code></pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.12.0</p></div></body></html>
10 Data-HashSet-Lens.html
@@ -11,9 +11,9 @@
11 11 </p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>setOf (folded._2) [(&quot;hello&quot;,1),(&quot;world&quot;,2),(&quot;!!!&quot;,3)]
12 12 </code></strong>fromList [1,2,3]
13 13 </pre><pre>
14   - setOf :: <code>Hashable</code> c =&gt; <code><a href="Control-Lens-Getter.html#t:Getter">Getter</a></code> a c -&gt; a -&gt; <code>HashSet</code> c
15   - setOf :: (<code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Eq.html#t:Eq">Eq</a></code> c, <code>Hashable</code> c) =&gt; <code><a href="Control-Lens-Fold.html#t:Fold">Fold</a></code> a c -&gt; a -&gt; <code>HashSet</code> c
16   - setOf :: <code>Hashable</code> c =&gt; <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code> a c -&gt; a -&gt; <code>HashSet</code> c
17   - setOf :: <code>Hashable</code> c =&gt; <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> a c -&gt; a -&gt; <code>HashSet</code> c
18   - setOf :: (<code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Eq.html#t:Eq">Eq</a></code> c, <code>Hashable</code> c) =&gt; <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Traversal.html#t:Traversal">Traversal</a></code> a c -&gt; a -&gt; <code>HashSet</code> c
  14 + <code><a href="Data-HashSet-Lens.html#v:setOf">setOf</a></code> :: <code>Hashable</code> c =&gt; <code><a href="Control-Lens-Getter.html#t:Getter">Getter</a></code> a c -&gt; a -&gt; <code>HashSet</code> c
  15 + <code><a href="Data-HashSet-Lens.html#v:setOf">setOf</a></code> :: (<code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Eq.html#t:Eq">Eq</a></code> c, <code>Hashable</code> c) =&gt; <code><a href="Control-Lens-Fold.html#t:Fold">Fold</a></code> a c -&gt; a -&gt; <code>HashSet</code> c
  16 + <code><a href="Data-HashSet-Lens.html#v:setOf">setOf</a></code> :: <code>Hashable</code> c =&gt; <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code> a c -&gt; a -&gt; <code>HashSet</code> c
  17 + <code><a href="Data-HashSet-Lens.html#v:setOf">setOf</a></code> :: <code>Hashable</code> c =&gt; <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> a c -&gt; a -&gt; <code>HashSet</code> c
  18 + <code><a href="Data-HashSet-Lens.html#v:setOf">setOf</a></code> :: (<code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Eq.html#t:Eq">Eq</a></code> c, <code>Hashable</code> c) =&gt; <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Traversal.html#t:Traversal">Traversal</a></code> a c -&gt; a -&gt; <code>HashSet</code> c
19 19 </pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.12.0</p></div></body></html>
12 Data-IntSet-Lens.html
@@ -8,16 +8,16 @@
8 8 the elements to new values.
9 9 </p><p>Sadly, you can't create a valid <code><a href="Control-Lens-Traversal.html#t:Traversal">Traversal</a></code> for a <code>Set</code>, because the number of
10 10 elements might change but you can manipulate it by reading using <code><a href="Control-Lens-Fold.html#v:folded">folded</a></code> and
11   - reindexing it via <code>setmap</code>.
  11 + reindexing it via <code><a href="Data-IntSet-Lens.html#v:setmapped">setmapped</a></code>.
12 12 </p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>over setmapped (+1) (fromList [1,2,3,4])
13 13 </code></strong>fromList [2,3,4,5]
14 14 </pre></div></div><div class="top"><p class="src"><a name="v:setOf" class="def">setOf</a> :: <a href="Control-Lens-Getter.html#t:Getting">Getting</a> <a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a> a b <a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Int.html#t:Int">Int</a> d -&gt; a -&gt; <a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a><a href="src/Data-IntSet-Lens.html#setOf" class="link">Source</a></p><div class="doc"><p>Construct an <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a></code> from a <code><a href="Control-Lens-Getter.html#t:Getter">Getter</a></code>, <code><a href="Control-Lens-Fold.html#t:Fold">Fold</a></code>, <code><a href="Control-Lens-Traversal.html#t:Traversal">Traversal</a></code>, <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> or <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code>.
15 15 </p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>setOf (folded._2) [(&quot;hello&quot;,1),(&quot;world&quot;,2),(&quot;!!!&quot;,3)]
16 16 </code></strong>fromList [1,2,3]
17 17 </pre><pre>
18   - setOf :: <code><a href="Control-Lens-Getter.html#t:Getter">Getter</a></code> a <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Int.html#t:Int">Int</a></code> -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a></code>
19   - setOf :: <code><a href="Control-Lens-Fold.html#t:Fold">Fold</a></code> a <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Int.html#t:Int">Int</a></code> -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a></code>
20   - setOf :: <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code> a <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Int.html#t:Int">Int</a></code> -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a></code>
21   - setOf :: <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> a <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Int.html#t:Int">Int</a></code> -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a></code>
22   - setOf :: <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Traversal.html#t:Traversal">Traversal</a></code> a <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Int.html#t:Int">Int</a></code> -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a></code>
  18 + <code><a href="Data-IntSet-Lens.html#v:setOf">setOf</a></code> :: <code><a href="Control-Lens-Getter.html#t:Getter">Getter</a></code> a <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Int.html#t:Int">Int</a></code> -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a></code>
  19 + <code><a href="Data-IntSet-Lens.html#v:setOf">setOf</a></code> :: <code><a href="Control-Lens-Fold.html#t:Fold">Fold</a></code> a <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Int.html#t:Int">Int</a></code> -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a></code>
  20 + <code><a href="Data-IntSet-Lens.html#v:setOf">setOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code> a <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Int.html#t:Int">Int</a></code> -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a></code>
  21 + <code><a href="Data-IntSet-Lens.html#v:setOf">setOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> a <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Int.html#t:Int">Int</a></code> -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a></code>
  22 + <code><a href="Data-IntSet-Lens.html#v:setOf">setOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Traversal.html#t:Traversal">Traversal</a></code> a <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Int.html#t:Int">Int</a></code> -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a></code>
23 23 </pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.12.0</p></div></body></html>
12 Data-Set-Lens.html
@@ -4,16 +4,16 @@
4 4 </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Set-Lens.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">lens-2.9: Lenses, Folds and Traversals</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>Edward Kmett &lt;ekmett@gmail.com&gt;</td></tr><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Data.Set.Lens</p></div><div id="description"><p class="caption">Description</p><div class="doc empty">&nbsp;</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"><a href="#v:setmapped">setmapped</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Ord.html#t:Ord">Ord</a> i, <a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Ord.html#t:Ord">Ord</a> j) =&gt; <a href="Control-Lens-Setter.html#t:Setter">Setter</a> (<a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a> i) (<a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a> j) i j</li><li class="src short"><a href="#v:setOf">setOf</a> :: <a href="Control-Lens-Getter.html#t:Getting">Getting</a> (<a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a> c) a b c d -&gt; a -&gt; <a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a> c</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:setmapped" class="def">setmapped</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Ord.html#t:Ord">Ord</a> i, <a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Ord.html#t:Ord">Ord</a> j) =&gt; <a href="Control-Lens-Setter.html#t:Setter">Setter</a> (<a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a> i) (<a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a> j) i j<a href="src/Data-Set-Lens.html#setmapped" class="link">Source</a></p><div class="doc"><p>This <code><a href="Control-Lens-Setter.html#t:Setter">Setter</a></code> can be used to change the type of a <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code> by mapping
5 5 the elements to new values.
6 6 </p><p>Sadly, you can't create a valid <code><a href="Control-Lens-Traversal.html#t:Traversal">Traversal</a></code> for a <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code>, but you can
7   - manipulate it by reading using <code>folded</code> and reindexing it via <code>setmap</code>.
  7 + manipulate it by reading using <code><a href="Control-Lens-Fold.html#t:folded">folded</a></code> and reindexing it via <code><a href="Data-Set-Lens.html#v:setmapped">setmapped</a></code>.
8 8 </p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>over setmapped (+1) (fromList [1,2,3,4])
9 9 </code></strong>fromList [2,3,4,5]
10 10 </pre></div></div><div class="top"><p class="src"><a name="v:setOf" class="def">setOf</a> :: <a href="Control-Lens-Getter.html#t:Getting">Getting</a> (<a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a> c) a b c d -&gt; a -&gt; <a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a> c<a href="src/Data-Set-Lens.html#setOf" class="link">Source</a></p><div class="doc"><p>Construct a set from a <code><a href="Control-Lens-Getter.html#t:Getter">Getter</a></code>, <code><a href="Control-Lens-Fold.html#t:Fold">Fold</a></code>, <code><a href="Control-Lens-Traversal.html#t:Traversal">Traversal</a></code>, <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> or <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code>.
11 11 </p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>setOf (folded._2) [(&quot;hello&quot;,1),(&quot;world&quot;,2),(&quot;!!!&quot;,3)]
12 12 </code></strong>fromList [1,2,3]
13 13 </pre><pre>
14   - setOf :: <code><a href="Control-Lens-Getter.html#t:Getter">Getter</a></code> a c -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code> c
15   - setOf :: <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Ord.html#t:Ord">Ord</a></code> c =&gt; <code><a href="Control-Lens-Fold.html#t:Fold">Fold</a></code> a c -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code> c
16   - setOf :: <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code> a c -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code> c
17   - setOf :: <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> a c -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code> c
18   - setOf :: <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Ord.html#t:Ord">Ord</a></code> c =&gt; <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Traversal.html#t:Traversal">Traversal</a></code> a c -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code> c
  14 + <code><a href="Data-Set-Lens.html#v:setOf">setOf</a></code> :: <code><a href="Control-Lens-Getter.html#t:Getter">Getter</a></code> a c -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code> c
  15 + <code><a href="Data-Set-Lens.html#v:setOf">setOf</a></code> :: <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Ord.html#t:Ord">Ord</a></code> c =&gt; <code><a href="Control-Lens-Fold.html#t:Fold">Fold</a></code> a c -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code> c
  16 + <code><a href="Data-Set-Lens.html#v:setOf">setOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Iso.html#t:Iso">Iso</a></code> a c -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code> c
  17 + <code><a href="Data-Set-Lens.html#v:setOf">setOf</a></code> :: <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> a c -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code> c
  18 + <code><a href="Data-Set-Lens.html#v:setOf">setOf</a></code> :: <code><a href="/usr/share/doc/ghc/html/libraries/base-4.6.0.0/Data-Ord.html#t:Ord">Ord</a></code> c =&gt; <code><a href="Control-Lens-Type.html#t:Simple">Simple</a></code> <code><a href="Control-Lens-Traversal.html#t:Traversal">Traversal</a></code> a c -&gt; a -&gt; <code><a href="/usr/share/doc/ghc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a></code> c
19 19 </pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.12.0</p></div></body></html>
4 index.html
@@ -26,7 +26,7 @@
26 26 </li></ul><p><em>Minimizing Dependencies</em>
27 27 </p><p>If you want to provide lenses and traversals for your own types in your own libraries, then you
28 28 can do so without incurring a dependency on this (or any other) lens package at all.
29   -</p><p>e.g. for a data type:
  29 +</p><p><em>e.g.</em> for a data type:
30 30 </p><pre> data Foo a = Foo Int Int a
31 31 </pre><p>You can define lenses such as
32 32 </p><pre> -- bar :: Simple Lens (Foo a) Int
@@ -42,5 +42,5 @@
42 42 traverseBarAndBaz f (Foo a b c) = Foo &lt;$&gt; f a &lt;*&gt; f b &lt;*&gt; pure c
43 43 </pre><p>What is provided in this library is a number of stock lenses and traversals for
44 44 common haskell types, a wide array of combinators for working them, and more
45   -exotic functionality, (e.g. getters, setters, indexed folds, isomorphisms).
  45 +exotic functionality, (<em>e.g.</em> getters, setters, indexed folds, isomorphisms).
46 46 </p></div></div><div id="module-list"><p class="caption">Modules</p><ul><li><span id="control.n.1" class="module collapser" onclick="toggleSection('n.1')">Control</span><ul id="section.n.1" class="show"><li><span id="control.n.1.1" class="module collapser" onclick="toggleSection('n.1.1')">Exception</span><ul id="section.n.1.1" class="show"><li><span class="module"><a href="Control-Exception-Lens.html">Control.Exception.Lens</a></span></li></ul></li><li><span class="module"><span id="control.n.1.2" class="collapser" onclick="toggleSection('n.1.2')">&nbsp;</span><a href="Control-Lens.html">Control.Lens</a></span><ul id="section.n.1.2" class="show"><li><span class="module"><a href="Control-Lens-Action.html">Control.Lens.Action</a></span></li><li><span class="module"><a href="Control-Lens-Combinators.html">Control.Lens.Combinators</a></span></li><li><span class="module"><a href="Control-Lens-Fold.html">Control.Lens.Fold</a></span></li><li><span class="module"><a href="Control-Lens-Getter.html">Control.Lens.Getter</a></span></li><li><span class="module"><a href="Control-Lens-Indexed.html">Control.Lens.Indexed</a></span></li><li><span class="module"><a href="Control-Lens-IndexedFold.html">Control.Lens.IndexedFold</a></span></li><li><span class="module"><a href="Control-Lens-IndexedGetter.html">Control.Lens.IndexedGetter</a></span></li><li><span class="module"><a href="Control-Lens-IndexedLens.html">Control.Lens.IndexedLens</a></span></li><li><span class="module"><a href="Control-Lens-IndexedSetter.html">Control.Lens.IndexedSetter</a></span></li><li><span class="module"><a href="Control-Lens-IndexedTraversal.html">Control.Lens.IndexedTraversal</a></span></li><li><span class="module"><a href="Control-Lens-Internal.html">Control.Lens.Internal</a></span></li><li><span class="module"><a href="Control-Lens-Iso.html">Control.Lens.Iso</a></span></li><li><span class="module"><a href="Control-Lens-Isomorphic.html">Control.Lens.Isomorphic</a></span></li><li><span class="module"><a href="Control-Lens-Plated.html">Control.Lens.Plated</a></span></li><li><span class="module"><a href="Control-Lens-Projection.html">Control.Lens.Projection</a></span></li><li><span class="module"><a href="Control-Lens-Representable.html">Control.Lens.Representable</a></span></li><li><span class="module"><a href="Control-Lens-Setter.html">Control.Lens.Setter</a></span></li><li><span class="module"><a href="Control-Lens-TH.html">Control.Lens.TH</a></span></li><li><span class="module"><a href="Control-Lens-Traversal.html">Control.Lens.Traversal</a></span></li><li><span class="module"><a href="Control-Lens-Tuple.html">Control.Lens.Tuple</a></span></li><li><span class="module"><a href="Control-Lens-Type.html">Control.Lens.Type</a></span></li><li><span class="module"><a href="Control-Lens-WithIndex.html">Control.Lens.WithIndex</a></span></li><li><span class="module"><a href="Control-Lens-Zoom.html">Control.Lens.Zoom</a></span></li></ul></li><li><span id="control.n.1.3" class="module collapser" onclick="toggleSection('n.1.3')">Parallel</span><ul id="section.n.1.3" class="show"><li><span id="control.n.1.3.1" class="module collapser" onclick="toggleSection('n.1.3.1')">Strategies</span><ul id="section.n.1.3.1" class="show"><li><span class="module"><a href="Control-Parallel-Strategies-Lens.html">Control.Parallel.Strategies.Lens</a></span></li></ul></li></ul></li><li><span id="control.n.1.4" class="module collapser" onclick="toggleSection('n.1.4')">Seq</span><ul id="section.n.1.4" class="show"><li><span class="module"><a href="Control-Seq-Lens.html">Control.Seq.Lens</a></span></li></ul></li></ul></li><li><span id="control.n.2" class="module collapser" onclick="toggleSection('n.2')">Data</span><ul id="section.n.2" class="show"><li><span id="control.n.2.1" class="module collapser" onclick="toggleSection('n.2.1')">Array</span><ul id="section.n.2.1" class="show"><li><span class="module"><a href="Data-Array-Lens.html">Data.Array.Lens</a></span></li></ul></li><li><span id="control.n.2.2" class="module collapser" onclick="toggleSection('n.2.2')">Bits</span><ul id="section.n.2.2" class="show"><li><span class="module"><a href="Data-Bits-Lens.html">Data.Bits.Lens</a></span></li></ul></li><li><span id="control.n.2.3" class="module collapser" onclick="toggleSection('n.2.3')">ByteString</span><ul id="section.n.2.3" class="show"><li><span id="control.n.2.3.1" class="module collapser" onclick="toggleSection('n.2.3.1')">Lazy</span><ul id="section.n.2.3.1" class="show"><li><span class="module"><a href="Data-ByteString-Lazy-Lens.html">Data.ByteString.Lazy.Lens</a></span></li></ul></li><li><span class="module"><a href="Data-ByteString-Lens.html">Data.ByteString.Lens</a></span></li><li><span id="control.n.2.3.3" class="module collapser" onclick="toggleSection('n.2.3.3')">Strict</span><ul id="section.n.2.3.3" class="show"><li><span class="module"><a href="Data-ByteString-Strict-Lens.html">Data.ByteString.Strict.Lens</a></span></li></ul></li></ul></li><li><span id="control.n.2.4" class="module collapser" onclick="toggleSection('n.2.4')">Complex</span><ul id="section.n.2.4" class="show"><li><span class="module"><a href="Data-Complex-Lens.html">Data.Complex.Lens</a></span></li></ul></li><li><span id="control.n.2.5" class="module collapser" onclick="toggleSection('n.2.5')">Data</span><ul id="section.n.2.5" class="show"><li><span class="module"><a href="Data-Data-Lens.html">Data.Data.Lens</a></span></li></ul></li><li><span id="control.n.2.6" class="module collapser" onclick="toggleSection('n.2.6')">Dynamic</span><ul id="section.n.2.6" class="show"><li><span class="module"><a href="Data-Dynamic-Lens.html">Data.Dynamic.Lens</a></span></li></ul></li><li><span id="control.n.2.7" class="module collapser" onclick="toggleSection('n.2.7')">HashSet</span><ul id="section.n.2.7" class="show"><li><span class="module"><a href="Data-HashSet-Lens.html">Data.HashSet.Lens</a></span></li></ul></li><li><span id="control.n.2.8" class="module collapser" onclick="toggleSection('n.2.8')">IntSet</span><ul id="section.n.2.8" class="show"><li><span class="module"><a href="Data-IntSet-Lens.html">Data.IntSet.Lens</a></span></li></ul></li><li><span id="control.n.2.9" class="module collapser" onclick="toggleSection('n.2.9')">List</span><ul id="section.n.2.9" class="show"><li><span class="module"><a href="Data-List-Lens.html">Data.List.Lens</a></span></li></ul></li><li><span id="control.n.2.10" class="module collapser" onclick="toggleSection('n.2.10')">Monoid</span><ul id="section.n.2.10" class="show"><li><span class="module"><a href="Data-Monoid-Lens.html">Data.Monoid.Lens</a></span></li></ul></li><li><span id="control.n.2.11" class="module collapser" onclick="toggleSection('n.2.11')">Sequence</span><ul id="section.n.2.11" class="show"><li><span class="module"><a href="Data-Sequence-Lens.html">Data.Sequence.Lens</a></span></li></ul></li><li><span id="control.n.2.12" class="module collapser" onclick="toggleSection('n.2.12')">Set</span><ul id="section.n.2.12" class="show"><li><span class="module"><a href="Data-Set-Lens.html">Data.Set.Lens</a></span></li></ul></li><li><span id="control.n.2.13" class="module collapser" onclick="toggleSection('n.2.13')">Text</span><ul id="section.n.2.13" class="show"><li><span id="control.n.2.13.1" class="module collapser" onclick="toggleSection('n.2.13.1')">Lazy</span><ul id="section.n.2.13.1" class="show"><li><span class="module"><a href="Data-Text-Lazy-Lens.html">Data.Text.Lazy.Lens</a></span></li></ul></li><li><span class="module"><a href="Data-Text-Lens.html">Data.Text.Lens</a></span></li><li><span id="control.n.2.13.3" class="module collapser" onclick="toggleSection('n.2.13.3')">Strict</span><ul id="section.n.2.13.3" class="show"><li><span class="module"><a href="Data-Text-Strict-Lens.html">Data.Text.Strict.Lens</a></span></li></ul></li></ul></li><li><span id="control.n.2.14" class="module collapser" onclick="toggleSection('n.2.14')">Tree</span><ul id="section.n.2.14" class="show"><li><span class="module"><a href="Data-Tree-Lens.html">Data.Tree.Lens</a></span></li></ul></li><li><span id="control.n.2.15" class="module collapser" onclick="toggleSection('n.2.15')">Typeable</span><ul id="section.n.2.15" class="show"><li><span class="module"><a href="Data-Typeable-Lens.html">Data.Typeable.Lens</a></span></li></ul></li></ul></li><li><span id="control.n.3" class="module collapser" onclick="toggleSection('n.3')">GHC</span><ul id="section.n.3" class="show"><li><span id="control.n.3.1" class="module collapser" onclick="toggleSection('n.3.1')">Generics</span><ul id="section.n.3.1" class="show"><li><span class="module"><a href="GHC-Generics-Lens.html">GHC.Generics.Lens</a></span></li></ul></li></ul></li><li><span id="control.n.4" class="module collapser" onclick="toggleSection('n.4')">Language</span><ul id="section.n.4" class="show"><li><span id="control.n.4.1" class="module collapser" onclick="toggleSection('n.4.1')">Haskell</span><ul id="section.n.4.1" class="show"><li><span id="control.n.4.1.1" class="module collapser" onclick="toggleSection('n.4.1.1')">TH</span><ul id="section.n.4.1.1" class="show"><li><span class="module"><a href="Language-Haskell-TH-Lens.html">Language.Haskell.TH.Lens</a></span></li></ul></li></ul></li></ul></li><li><span id="control.n.5" class="module collapser" onclick="toggleSection('n.5')">System</span><ul id="section.n.5" class="show"><li><span id="control.n.5.1" class="module collapser" onclick="toggleSection('n.5.1')">FilePath</span><ul id="section.n.5.1" class="show"><li><span class="module"><a href="System-FilePath-Lens.html">System.FilePath.Lens</a></span></li></ul></li></ul></li></ul></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.12.0</p></div></body></html>
BIN  lens.haddock
Binary file not shown
198 src/Control-Lens-Iso.html
@@ -64,106 +64,108 @@
64 64 <a name="line-55"></a><a name="Iso"></a><span class='hs-comment'>-- with each other using ('.') from the Prelude, they will be dumbed down to a</span>
65 65 <a name="line-56"></a><a name="Iso"></a><span class='hs-comment'>-- mere 'Lens'.</span>
66 66 <a name="line-57"></a><a name="Iso"></a><span class='hs-comment'>--</span>
67   -<a name="line-58"></a><a name="Iso"></a><span class='hs-comment'>-- &gt; import Control.Category</span>
68   -<a name="line-59"></a><a name="Iso"></a><span class='hs-comment'>-- &gt; import Prelude hiding ((.),id)</span>
69   -<a name="line-60"></a><a name="Iso"></a><span class='hs-comment'>--</span>
70   -<a name="line-61"></a><a name="Iso"></a><span class='hs-comment'>-- @type Iso a b c d = forall k f. ('Isomorphic' k, 'Functor' f) =&gt; 'Overloaded' k f a b c d@</span>
71   -<a name="line-62"></a><a name="Iso"></a><span class='hs-keyword'>type</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>c</span> <span class='hs-varid'>d</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>forall</span> <span class='hs-varid'>k</span> <span class='hs-varid'>f</span><span class='hs-varop'>.</span> <span class='hs-layout'>(</span><span class='hs-conid'>Isomorphic</span> <span class='hs-varid'>k</span><span class='hs-layout'>,</span> <span class='hs-conid'>Functor</span> <span class='hs-varid'>f</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-varid'>k</span> <span class='hs-layout'>(</span><span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>d</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span>
72   -<a name="line-63"></a>
73   -<a name="line-64"></a><a name="SimpleIso"></a><span class='hs-comment'>-- |</span>
74   -<a name="line-65"></a><a name="SimpleIso"></a><span class='hs-comment'>-- @type SimpleIso = 'Control.Lens.Type.Simple' 'Iso'@</span>
75   -<a name="line-66"></a><a name="SimpleIso"></a><span class='hs-keyword'>type</span> <span class='hs-conid'>SimpleIso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>b</span>
76   -<a name="line-67"></a>
77   -<a name="line-68"></a><a name="isos"></a><span class='hs-comment'>-- | Build an isomorphism family from two pairs of inverse functions</span>
78   -<a name="line-69"></a><span class='hs-comment'>--</span>
79   -<a name="line-70"></a><span class='hs-comment'>-- @</span>
80   -<a name="line-71"></a><span class='hs-comment'>-- 'view' ('isos' ac ca bd db) ≡ ac</span>
81   -<a name="line-72"></a><span class='hs-comment'>-- 'view' ('from' ('isos' ac ca bd db)) ≡ ca</span>
82   -<a name="line-73"></a><span class='hs-comment'>-- 'set' ('isos' ac ca bd db) cd ≡ db '.' cd '.' ac</span>
83   -<a name="line-74"></a><span class='hs-comment'>-- 'set' ('from' ('isos' ac ca bd db')) ab ≡ bd '.' ab '.' ca</span>
84   -<a name="line-75"></a><span class='hs-comment'>-- @</span>
85   -<a name="line-76"></a><span class='hs-comment'>--</span>
86   -<a name="line-77"></a><span class='hs-comment'>-- @isos :: (a -&gt; c) -&gt; (c -&gt; a) -&gt; (b -&gt; d) -&gt; (d -&gt; b) -&gt; 'Iso' a b c d@</span>
87   -<a name="line-78"></a><span class='hs-definition'>isos</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-conid'>Isomorphic</span> <span class='hs-varid'>k</span><span class='hs-layout'>,</span> <span class='hs-conid'>Functor</span> <span class='hs-varid'>f</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>b</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>d</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>d</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>k</span> <span class='hs-layout'>(</span><span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>d</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span>
88   -<a name="line-79"></a><span class='hs-definition'>isos</span> <span class='hs-varid'>ac</span> <span class='hs-varid'>ca</span> <span class='hs-varid'>bd</span> <span class='hs-varid'>db</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>isomorphic</span>
89   -<a name="line-80"></a> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>cfd</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>db</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>cfd</span> <span class='hs-layout'>(</span><span class='hs-varid'>ac</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
90   -<a name="line-81"></a> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>afb</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>bd</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>afb</span> <span class='hs-layout'>(</span><span class='hs-varid'>ca</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
91   -<a name="line-82"></a><span class='hs-comment'>{-# INLINE isos #-}</span>
92   -<a name="line-83"></a>
93   -<a name="line-84"></a><a name="iso"></a><span class='hs-comment'>-- | Build a simple isomorphism from a pair of inverse functions</span>
94   -<a name="line-85"></a><span class='hs-comment'>--</span>
95   -<a name="line-86"></a><span class='hs-comment'>--</span>
96   -<a name="line-87"></a><span class='hs-comment'>-- @</span>
97   -<a name="line-88"></a><span class='hs-comment'>-- 'view' ('iso' f g) ≡ f</span>
98   -<a name="line-89"></a><span class='hs-comment'>-- 'view' ('from' ('iso' f g)) ≡ g</span>
99   -<a name="line-90"></a><span class='hs-comment'>-- 'set' ('isos' f g) h ≡ g '.' h '.' f</span>
100   -<a name="line-91"></a><span class='hs-comment'>-- 'set' ('from' ('iso' f g')) h ≡ f '.' h '.' g</span>
101   -<a name="line-92"></a><span class='hs-comment'>-- @</span>
102   -<a name="line-93"></a><span class='hs-comment'>--</span>
103   -<a name="line-94"></a><span class='hs-comment'>-- @iso :: (a -&gt; b) -&gt; (b -&gt; a) -&gt; 'Control.Lens.Type.Simple' 'Iso' a b@</span>
104   -<a name="line-95"></a><span class='hs-definition'>iso</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-conid'>Isomorphic</span> <span class='hs-varid'>k</span><span class='hs-layout'>,</span> <span class='hs-conid'>Functor</span> <span class='hs-varid'>f</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>b</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>k</span> <span class='hs-layout'>(</span><span class='hs-varid'>b</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span>
105   -<a name="line-96"></a><span class='hs-definition'>iso</span> <span class='hs-varid'>ab</span> <span class='hs-varid'>ba</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>isos</span> <span class='hs-varid'>ab</span> <span class='hs-varid'>ba</span> <span class='hs-varid'>ab</span> <span class='hs-varid'>ba</span>
106   -<a name="line-97"></a><span class='hs-comment'>{-# INLINE iso #-}</span>
107   -<a name="line-98"></a>
108   -<a name="line-99"></a><a name="ala"></a><span class='hs-comment'>-- | Based on @ala@ from Conor McBride's work on Epigram.</span>
109   -<a name="line-100"></a><span class='hs-comment'>--</span>
110   -<a name="line-101"></a><span class='hs-comment'>-- &gt;&gt;&gt; :m + Data.Monoid.Lens Data.Foldable</span>
111   -<a name="line-102"></a><span class='hs-comment'>-- &gt;&gt;&gt; ala _sum foldMap [1,2,3,4]</span>
112   -<a name="line-103"></a><span class='hs-comment'>-- 10</span>
113   -<a name="line-104"></a><span class='hs-definition'>ala</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Simple</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span>
114   -<a name="line-105"></a><span class='hs-definition'>ala</span> <span class='hs-varid'>l</span> <span class='hs-varid'>f</span> <span class='hs-varid'>e</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>f</span> <span class='hs-layout'>(</span><span class='hs-varid'>view</span> <span class='hs-varid'>l</span><span class='hs-layout'>)</span> <span class='hs-varid'>e</span> <span class='hs-varop'>^.</span> <span class='hs-varid'>from</span> <span class='hs-varid'>l</span>
115   -<a name="line-106"></a><span class='hs-comment'>{-# INLINE ala #-}</span>
116   -<a name="line-107"></a>
117   -<a name="line-108"></a><a name="auf"></a><span class='hs-comment'>-- |</span>
118   -<a name="line-109"></a><span class='hs-comment'>-- Based on @ala'@ from Conor McBride's work on Epigram.</span>
119   -<a name="line-110"></a><span class='hs-comment'>--</span>
120   -<a name="line-111"></a><span class='hs-comment'>-- Mnemonically, the German /auf/ plays a similar role to /à la/, and the combinator</span>
121   -<a name="line-112"></a><span class='hs-comment'>-- is /au/ with an extra function argument.</span>
122   -<a name="line-113"></a><span class='hs-definition'>auf</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Simple</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-layout'>(</span><span class='hs-varid'>d</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>d</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span>
123   -<a name="line-114"></a><span class='hs-definition'>auf</span> <span class='hs-varid'>l</span> <span class='hs-varid'>f</span> <span class='hs-varid'>g</span> <span class='hs-varid'>e</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>f</span> <span class='hs-layout'>(</span><span class='hs-varid'>view</span> <span class='hs-varid'>l</span> <span class='hs-varop'>.</span> <span class='hs-varid'>g</span><span class='hs-layout'>)</span> <span class='hs-varid'>e</span> <span class='hs-varop'>^.</span> <span class='hs-varid'>from</span> <span class='hs-varid'>l</span>
124   -<a name="line-115"></a><span class='hs-comment'>{-# INLINE auf #-}</span>
125   -<a name="line-116"></a>
126   -<a name="line-117"></a><a name="under"></a><span class='hs-comment'>-- | The opposite of working 'over' a Setter is working 'under' an Isomorphism.</span>
127   -<a name="line-118"></a><span class='hs-comment'>--</span>
128   -<a name="line-119"></a><span class='hs-comment'>-- @'under' = 'over' '.' 'from'@</span>
  67 +<a name="line-58"></a><a name="Iso"></a><span class='hs-comment'>-- @</span>
  68 +<a name="line-59"></a><a name="Iso"></a><span class='hs-comment'>-- import Control.Category</span>
  69 +<a name="line-60"></a><a name="Iso"></a><span class='hs-comment'>-- import Prelude hiding (('Prelude..'),'Prelude.id')</span>
  70 +<a name="line-61"></a><a name="Iso"></a><span class='hs-comment'>-- @</span>
  71 +<a name="line-62"></a><a name="Iso"></a><span class='hs-comment'>--</span>
  72 +<a name="line-63"></a><a name="Iso"></a><span class='hs-comment'>-- @type 'Iso' a b c d = forall k f. ('Isomorphic' k, 'Functor' f) =&gt; 'Overloaded' k f a b c d@</span>
  73 +<a name="line-64"></a><a name="Iso"></a><span class='hs-keyword'>type</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>c</span> <span class='hs-varid'>d</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>forall</span> <span class='hs-varid'>k</span> <span class='hs-varid'>f</span><span class='hs-varop'>.</span> <span class='hs-layout'>(</span><span class='hs-conid'>Isomorphic</span> <span class='hs-varid'>k</span><span class='hs-layout'>,</span> <span class='hs-conid'>Functor</span> <span class='hs-varid'>f</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-varid'>k</span> <span class='hs-layout'>(</span><span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>d</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span>
  74 +<a name="line-65"></a>
  75 +<a name="line-66"></a><a name="SimpleIso"></a><span class='hs-comment'>-- |</span>
  76 +<a name="line-67"></a><a name="SimpleIso"></a><span class='hs-comment'>-- @type 'SimpleIso' = 'Control.Lens.Type.Simple' 'Iso'@</span>
  77 +<a name="line-68"></a><a name="SimpleIso"></a><span class='hs-keyword'>type</span> <span class='hs-conid'>SimpleIso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>b</span>
  78 +<a name="line-69"></a>
  79 +<a name="line-70"></a><a name="isos"></a><span class='hs-comment'>-- | Build an isomorphism family from two pairs of inverse functions</span>
  80 +<a name="line-71"></a><span class='hs-comment'>--</span>
  81 +<a name="line-72"></a><span class='hs-comment'>-- @</span>
  82 +<a name="line-73"></a><span class='hs-comment'>-- 'view' ('isos' ac ca bd db) ≡ ac</span>
  83 +<a name="line-74"></a><span class='hs-comment'>-- 'view' ('from' ('isos' ac ca bd db)) ≡ ca</span>
  84 +<a name="line-75"></a><span class='hs-comment'>-- 'set' ('isos' ac ca bd db) cd ≡ db '.' cd '.' ac</span>
  85 +<a name="line-76"></a><span class='hs-comment'>-- 'set' ('from' ('isos' ac ca bd db')) ab ≡ bd '.' ab '.' ca</span>
  86 +<a name="line-77"></a><span class='hs-comment'>-- @</span>
  87 +<a name="line-78"></a><span class='hs-comment'>--</span>
  88 +<a name="line-79"></a><span class='hs-comment'>-- @isos :: (a -&gt; c) -&gt; (c -&gt; a) -&gt; (b -&gt; d) -&gt; (d -&gt; b) -&gt; 'Iso' a b c d@</span>
  89 +<a name="line-80"></a><span class='hs-definition'>isos</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-conid'>Isomorphic</span> <span class='hs-varid'>k</span><span class='hs-layout'>,</span> <span class='hs-conid'>Functor</span> <span class='hs-varid'>f</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>b</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>d</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>d</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>k</span> <span class='hs-layout'>(</span><span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>d</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span>
  90 +<a name="line-81"></a><span class='hs-definition'>isos</span> <span class='hs-varid'>ac</span> <span class='hs-varid'>ca</span> <span class='hs-varid'>bd</span> <span class='hs-varid'>db</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>isomorphic</span>
  91 +<a name="line-82"></a> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>cfd</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>db</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>cfd</span> <span class='hs-layout'>(</span><span class='hs-varid'>ac</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
  92 +<a name="line-83"></a> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>afb</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>bd</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>afb</span> <span class='hs-layout'>(</span><span class='hs-varid'>ca</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
  93 +<a name="line-84"></a><span class='hs-comment'>{-# INLINE isos #-}</span>
  94 +<a name="line-85"></a>
  95 +<a name="line-86"></a><a name="iso"></a><span class='hs-comment'>-- | Build a simple isomorphism from a pair of inverse functions</span>
  96 +<a name="line-87"></a><span class='hs-comment'>--</span>
  97 +<a name="line-88"></a><span class='hs-comment'>--</span>
  98 +<a name="line-89"></a><span class='hs-comment'>-- @</span>
  99 +<a name="line-90"></a><span class='hs-comment'>-- 'view' ('iso' f g) ≡ f</span>
  100 +<a name="line-91"></a><span class='hs-comment'>-- 'view' ('from' ('iso' f g)) ≡ g</span>
  101 +<a name="line-92"></a><span class='hs-comment'>-- 'set' ('isos' f g) h ≡ g '.' h '.' f</span>
  102 +<a name="line-93"></a><span class='hs-comment'>-- 'set' ('from' ('iso' f g')) h ≡ f '.' h '.' g</span>
  103 +<a name="line-94"></a><span class='hs-comment'>-- @</span>
  104 +<a name="line-95"></a><span class='hs-comment'>--</span>
  105 +<a name="line-96"></a><span class='hs-comment'>-- @iso :: (a -&gt; b) -&gt; (b -&gt; a) -&gt; 'Control.Lens.Type.Simple' 'Iso' a b@</span>
  106 +<a name="line-97"></a><span class='hs-definition'>iso</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-conid'>Isomorphic</span> <span class='hs-varid'>k</span><span class='hs-layout'>,</span> <span class='hs-conid'>Functor</span> <span class='hs-varid'>f</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>b</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>k</span> <span class='hs-layout'>(</span><span class='hs-varid'>b</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>f</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span>
  107 +<a name="line-98"></a><span class='hs-definition'>iso</span> <span class='hs-varid'>ab</span> <span class='hs-varid'>ba</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>isos</span> <span class='hs-varid'>ab</span> <span class='hs-varid'>ba</span> <span class='hs-varid'>ab</span> <span class='hs-varid'>ba</span>
  108 +<a name="line-99"></a><span class='hs-comment'>{-# INLINE iso #-}</span>
  109 +<a name="line-100"></a>
  110 +<a name="line-101"></a><a name="ala"></a><span class='hs-comment'>-- | Based on @ala@ from Conor McBride's work on Epigram.</span>
  111 +<a name="line-102"></a><span class='hs-comment'>--</span>
  112 +<a name="line-103"></a><span class='hs-comment'>-- &gt;&gt;&gt; :m + Data.Monoid.Lens Data.Foldable</span>
  113 +<a name="line-104"></a><span class='hs-comment'>-- &gt;&gt;&gt; ala _sum foldMap [1,2,3,4]</span>
  114 +<a name="line-105"></a><span class='hs-comment'>-- 10</span>
  115 +<a name="line-106"></a><span class='hs-definition'>ala</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Simple</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span>
  116 +<a name="line-107"></a><span class='hs-definition'>ala</span> <span class='hs-varid'>l</span> <span class='hs-varid'>f</span> <span class='hs-varid'>e</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>f</span> <span class='hs-layout'>(</span><span class='hs-varid'>view</span> <span class='hs-varid'>l</span><span class='hs-layout'>)</span> <span class='hs-varid'>e</span> <span class='hs-varop'>^.</span> <span class='hs-varid'>from</span> <span class='hs-varid'>l</span>
  117 +<a name="line-108"></a><span class='hs-comment'>{-# INLINE ala #-}</span>
  118 +<a name="line-109"></a>
  119 +<a name="line-110"></a><a name="auf"></a><span class='hs-comment'>-- |</span>
  120 +<a name="line-111"></a><span class='hs-comment'>-- Based on @ala'@ from Conor McBride's work on Epigram.</span>
  121 +<a name="line-112"></a><span class='hs-comment'>--</span>
  122 +<a name="line-113"></a><span class='hs-comment'>-- Mnemonically, the German /auf/ plays a similar role to /à la/, and the combinator</span>
  123 +<a name="line-114"></a><span class='hs-comment'>-- is 'ala' with an extra function argument.</span>
  124 +<a name="line-115"></a><span class='hs-definition'>auf</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Simple</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-layout'>(</span><span class='hs-varid'>d</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>d</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span>
  125 +<a name="line-116"></a><span class='hs-definition'>auf</span> <span class='hs-varid'>l</span> <span class='hs-varid'>f</span> <span class='hs-varid'>g</span> <span class='hs-varid'>e</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>f</span> <span class='hs-layout'>(</span><span class='hs-varid'>view</span> <span class='hs-varid'>l</span> <span class='hs-varop'>.</span> <span class='hs-varid'>g</span><span class='hs-layout'>)</span> <span class='hs-varid'>e</span> <span class='hs-varop'>^.</span> <span class='hs-varid'>from</span> <span class='hs-varid'>l</span>
  126 +<a name="line-117"></a><span class='hs-comment'>{-# INLINE auf #-}</span>
  127 +<a name="line-118"></a>
  128 +<a name="line-119"></a><a name="under"></a><span class='hs-comment'>-- | The opposite of working 'over' a Setter is working 'under' an Isomorphism.</span>
129 129 <a name="line-120"></a><span class='hs-comment'>--</span>
130   -<a name="line-121"></a><span class='hs-comment'>-- @'under' :: Iso a b c d -&gt; (a -&gt; b) -&gt; (c -&gt; d)@</span>
131   -<a name="line-122"></a><span class='hs-definition'>under</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Isomorphism</span> <span class='hs-layout'>(</span><span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Mutator</span> <span class='hs-varid'>d</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Mutator</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>d</span>
132   -<a name="line-123"></a><span class='hs-definition'>under</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>over</span> <span class='hs-varop'>.</span> <span class='hs-varid'>from</span>
133   -<a name="line-124"></a><span class='hs-comment'>{-# INLINE under #-}</span>
134   -<a name="line-125"></a>
135   -<a name="line-126"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
136   -<a name="line-127"></a><span class='hs-comment'>-- Isomorphisms</span>
  130 +<a name="line-121"></a><span class='hs-comment'>-- @'under' = 'over' '.' 'from'@</span>
  131 +<a name="line-122"></a><span class='hs-comment'>--</span>
  132 +<a name="line-123"></a><span class='hs-comment'>-- @'under' :: 'Iso' a b c d -&gt; (a -&gt; b) -&gt; c -&gt; d@</span>
  133 +<a name="line-124"></a><span class='hs-definition'>under</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Isomorphism</span> <span class='hs-layout'>(</span><span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Mutator</span> <span class='hs-varid'>d</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Mutator</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>d</span>
  134 +<a name="line-125"></a><span class='hs-definition'>under</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>over</span> <span class='hs-varop'>.</span> <span class='hs-varid'>from</span>
  135 +<a name="line-126"></a><span class='hs-comment'>{-# INLINE under #-}</span>
  136 +<a name="line-127"></a>
137 137 <a name="line-128"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
138   -<a name="line-129"></a>
139   -<a name="line-130"></a><a name="identity"></a><span class='hs-comment'>-- | This isomorphism can be used to wrap or unwrap a value in 'Identity'.</span>
140   -<a name="line-131"></a><span class='hs-comment'>--</span>
141   -<a name="line-132"></a><span class='hs-comment'>-- @</span>
142   -<a name="line-133"></a><span class='hs-comment'>-- x^.identity ≡ 'Identity' x</span>
143   -<a name="line-134"></a><span class='hs-comment'>-- 'Identity' x '^.' 'from' 'identity' ≡ x</span>
144   -<a name="line-135"></a><span class='hs-comment'>-- @</span>
145   -<a name="line-136"></a><span class='hs-definition'>identity</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-layout'>(</span><span class='hs-conid'>Identity</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>Identity</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span>
146   -<a name="line-137"></a><span class='hs-definition'>identity</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>isos</span> <span class='hs-conid'>Identity</span> <span class='hs-varid'>runIdentity</span> <span class='hs-conid'>Identity</span> <span class='hs-varid'>runIdentity</span>
147   -<a name="line-138"></a><span class='hs-comment'>{-# INLINE identity #-}</span>
148   -<a name="line-139"></a>
149   -<a name="line-140"></a><span class='hs-comment'>-- | This isomorphism can be used to wrap or unwrap a value in 'Const'</span>
150   -<a name="line-141"></a><span class='hs-comment'>--</span>
151   -<a name="line-142"></a><span class='hs-comment'>-- @</span>
152   -<a name="line-143"></a><span class='hs-comment'>-- x '^.' '_const' ≡ 'Const' x</span>
153   -<a name="line-144"></a><span class='hs-comment'>-- 'Const' x '^.' 'from' '_const' ≡ x</span>
154   -<a name="line-145"></a><span class='hs-comment'>-- @</span>
155   -<a name="line-146"></a><span class='hs-sel'>_const</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-layout'>(</span><span class='hs-conid'>Const</span> <span class='hs-varid'>a</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>Const</span> <span class='hs-varid'>b</span> <span class='hs-varid'>d</span><span class='hs-layout'>)</span>
156   -<a name="line-147"></a><span class='hs-sel'>_const</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>isos</span> <span class='hs-conid'>Const</span> <span class='hs-varid'>getConst</span> <span class='hs-conid'>Const</span> <span class='hs-varid'>getConst</span>
157   -<a name="line-148"></a><span class='hs-comment'>{-# INLINE _const #-}</span>
158   -<a name="line-149"></a>
159   -<a name="line-150"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
160   -<a name="line-151"></a><span class='hs-comment'>-- Reifying Isomorphisms</span>
  138 +<a name="line-129"></a><span class='hs-comment'>-- Isomorphisms</span>
  139 +<a name="line-130"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
  140 +<a name="line-131"></a>
  141 +<a name="line-132"></a><a name="identity"></a><span class='hs-comment'>-- | This isomorphism can be used to wrap or unwrap a value in 'Identity'.</span>
  142 +<a name="line-133"></a><span class='hs-comment'>--</span>
  143 +<a name="line-134"></a><span class='hs-comment'>-- @</span>
  144 +<a name="line-135"></a><span class='hs-comment'>-- x^.identity ≡ 'Identity' x</span>
  145 +<a name="line-136"></a><span class='hs-comment'>-- 'Identity' x '^.' 'from' 'identity' ≡ x</span>
  146 +<a name="line-137"></a><span class='hs-comment'>-- @</span>
  147 +<a name="line-138"></a><span class='hs-definition'>identity</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-layout'>(</span><span class='hs-conid'>Identity</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>Identity</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span>
  148 +<a name="line-139"></a><span class='hs-definition'>identity</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>isos</span> <span class='hs-conid'>Identity</span> <span class='hs-varid'>runIdentity</span> <span class='hs-conid'>Identity</span> <span class='hs-varid'>runIdentity</span>
  149 +<a name="line-140"></a><span class='hs-comment'>{-# INLINE identity #-}</span>
  150 +<a name="line-141"></a>
  151 +<a name="line-142"></a><span class='hs-comment'>-- | This isomorphism can be used to wrap or unwrap a value in 'Const'</span>
  152 +<a name="line-143"></a><span class='hs-comment'>--</span>
  153 +<a name="line-144"></a><span class='hs-comment'>-- @</span>
  154 +<a name="line-145"></a><span class='hs-comment'>-- x '^.' '_const' ≡ 'Const' x</span>
  155 +<a name="line-146"></a><span class='hs-comment'>-- 'Const' x '^.' 'from' '_const' ≡ x</span>
  156 +<a name="line-147"></a><span class='hs-comment'>-- @</span>
  157 +<a name="line-148"></a><span class='hs-sel'>_const</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-layout'>(</span><span class='hs-conid'>Const</span> <span class='hs-varid'>a</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>Const</span> <span class='hs-varid'>b</span> <span class='hs-varid'>d</span><span class='hs-layout'>)</span>
  158 +<a name="line-149"></a><span class='hs-sel'>_const</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>isos</span> <span class='hs-conid'>Const</span> <span class='hs-varid'>getConst</span> <span class='hs-conid'>Const</span> <span class='hs-varid'>getConst</span>
  159 +<a name="line-150"></a><span class='hs-comment'>{-# INLINE _const #-}</span>
  160 +<a name="line-151"></a>
161 161 <a name="line-152"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
162   -<a name="line-153"></a>
163   -<a name="line-154"></a><a name="ReifiedIso"></a><span class='hs-comment'>-- | Useful for storing isomorphisms in containers.</span>
164   -<a name="line-155"></a><a name="ReifiedIso"></a><span class='hs-keyword'>newtype</span> <span class='hs-conid'>ReifiedIso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>c</span> <span class='hs-varid'>d</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>ReifyIso</span> <span class='hs-layout'>{</span> <span class='hs-varid'>reflectIso</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>c</span> <span class='hs-varid'>d</span> <span class='hs-layout'>}</span>
165   -<a name="line-156"></a>
166   -<a name="line-157"></a><a name="SimpleReifiedIso"></a><span class='hs-comment'>-- | @type SimpleReifiedIso = 'Control.Lens.Type.Simple' 'ReifiedIso'@</span>
167   -<a name="line-158"></a><a name="SimpleReifiedIso"></a><span class='hs-keyword'>type</span> <span class='hs-conid'>SimpleReifiedIso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>ReifiedIso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>b</span>
  162 +<a name="line-153"></a><span class='hs-comment'>-- Reifying Isomorphisms</span>
  163 +<a name="line-154"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
  164 +<a name="line-155"></a>
  165 +<a name="line-156"></a><a name="ReifiedIso"></a><span class='hs-comment'>-- | Useful for storing isomorphisms in containers.</span>
  166 +<a name="line-157"></a><a name="ReifiedIso"></a><span class='hs-keyword'>newtype</span> <span class='hs-conid'>ReifiedIso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>c</span> <span class='hs-varid'>d</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>ReifyIso</span> <span class='hs-layout'>{</span> <span class='hs-varid'>reflectIso</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Iso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>c</span> <span class='hs-varid'>d</span> <span class='hs-layout'>}</span>
  167 +<a name="line-158"></a>
  168 +<a name="line-159"></a><a name="SimpleReifiedIso"></a><span class='hs-comment'>-- | @type 'SimpleReifiedIso' = 'Control.Lens.Type.Simple' 'ReifiedIso'@</span>
  169 +<a name="line-160"></a><a name="SimpleReifiedIso"></a><span class='hs-keyword'>type</span> <span class='hs-conid'>SimpleReifiedIso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>ReifiedIso</span> <span class='hs-varid'>a</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>b</span>
168 170 </pre></body>
169 171 </html>
10 src/Data-HashSet-Lens.html
@@ -50,11 +50,11 @@
50 50 <a name="line-41"></a><span class='hs-comment'>-- fromList [1,2,3]</span>
51 51 <a name="line-42"></a><span class='hs-comment'>--</span>
52 52 <a name="line-43"></a><span class='hs-comment'>-- @</span>
53   -<a name="line-44"></a><span class='hs-comment'>-- setOf :: 'Hashable' c =&gt; 'Getter' a c -&gt; a -&gt; 'HashSet' c</span>
54   -<a name="line-45"></a><span class='hs-comment'>-- setOf :: ('Eq' c, 'Hashable' c) =&gt; 'Control.Lens.Fold.Fold' a c -&gt; a -&gt; 'HashSet' c</span>
55   -<a name="line-46"></a><span class='hs-comment'>-- setOf :: 'Hashable' c =&gt; 'Control.Lens.Type.Simple' 'Control.Lens.Iso.Iso' a c -&gt; a -&gt; 'HashSet' c</span>
56   -<a name="line-47"></a><span class='hs-comment'>-- setOf :: 'Hashable' c =&gt; 'Control.Lens.Type.Simple' 'Control.Lens.Type.Lens' a c -&gt; a -&gt; 'HashSet' c</span>
57   -<a name="line-48"></a><span class='hs-comment'>-- setOf :: ('Eq' c, 'Hashable' c) =&gt; 'Control.Lens.Type.Simple' 'Control.Lens.Traversal.Traversal' a c -&gt; a -&gt; 'HashSet' c</span>
  53 +<a name="line-44"></a><span class='hs-comment'>-- 'setOf' :: 'Hashable' c =&gt; 'Getter' a c -&gt; a -&gt; 'HashSet' c</span>
  54 +<a name="line-45"></a><span class='hs-comment'>-- 'setOf' :: ('Eq' c, 'Hashable' c) =&gt; 'Control.Lens.Fold.Fold' a c -&gt; a -&gt; 'HashSet' c</span>
  55 +<a name="line-46"></a><span class='hs-comment'>-- 'setOf' :: 'Hashable' c =&gt; 'Control.Lens.Type.Simple' 'Control.Lens.Iso.Iso' a c -&gt; a -&gt; 'HashSet' c</span>
  56 +<a name="line-47"></a><span class='hs-comment'>-- 'setOf' :: 'Hashable' c =&gt; 'Control.Lens.Type.Simple' 'Control.Lens.Type.Lens' a c -&gt; a -&gt; 'HashSet' c</span>
  57 +<a name="line-48"></a><span class='hs-comment'>-- 'setOf' :: ('Eq' c, 'Hashable' c) =&gt; 'Control.Lens.Type.Simple' 'Control.Lens.Traversal.Traversal' a c -&gt; a -&gt; 'HashSet' c</span>
58 58 <a name="line-49"></a><span class='hs-comment'>-- @</span>
59 59 <a name="line-50"></a><span class='hs-definition'>setOf</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Hashable</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>=&gt;</span> <span class='hs-conid'>Getting</span> <span class='hs-layout'>(</span><span class='hs-conid'>HashSet</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>c</span> <span class='hs-varid'>d</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>HashSet</span> <span class='hs-varid'>c</span>
60 60 <a name="line-51"></a><span class='hs-definition'>setOf</span> <span class='hs-varid'>l</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>runAccessor</span> <span class='hs-varop'>.</span> <span class='hs-varid'>l</span> <span class='hs-layout'>(</span><span class='hs-conid'>Accessor</span> <span class='hs-varop'>.</span> <span class='hs-conid'>HashSet</span><span class='hs-varop'>.</span><span class='hs-varid'>singleton</span><span class='hs-layout'>)</span>
12 src/Data-IntSet-Lens.html
@@ -44,7 +44,7 @@
44 44 <a name="line-35"></a><span class='hs-comment'>--</span>
45 45 <a name="line-36"></a><span class='hs-comment'>-- Sadly, you can't create a valid 'Traversal' for a 'Set', because the number of</span>
46 46 <a name="line-37"></a><span class='hs-comment'>-- elements might change but you can manipulate it by reading using 'folded' and</span>
47   -<a name="line-38"></a><span class='hs-comment'>-- reindexing it via 'setmap'.</span>
  47 +<a name="line-38"></a><span class='hs-comment'>-- reindexing it via 'setmapped'.</span>
48 48 <a name="line-39"></a><span class='hs-comment'>--</span>
49 49 <a name="line-40"></a><span class='hs-comment'>-- &gt;&gt;&gt; over setmapped (+1) (fromList [1,2,3,4])</span>
50 50 <a name="line-41"></a><span class='hs-comment'>-- fromList [2,3,4,5]</span>
@@ -58,11 +58,11 @@
58 58 <a name="line-49"></a><span class='hs-comment'>-- fromList [1,2,3]</span>
59 59 <a name="line-50"></a><span class='hs-comment'>--</span>
60 60 <a name="line-51"></a><span class='hs-comment'>-- @</span>
61   -<a name="line-52"></a><span class='hs-comment'>-- setOf :: 'Getter' a 'Int' -&gt; a -&gt; 'IntSet'</span>
62   -<a name="line-53"></a><span class='hs-comment'>-- setOf :: 'Fold' a 'Int' -&gt; a -&gt; 'IntSet'</span>
63   -<a name="line-54"></a><span class='hs-comment'>-- setOf :: 'Simple' 'Iso' a 'Int' -&gt; a -&gt; 'IntSet'</span>
64   -<a name="line-55"></a><span class='hs-comment'>-- setOf :: 'Simple' 'Lens' a 'Int' -&gt; a -&gt; 'IntSet'</span>
65   -<a name="line-56"></a><span class='hs-comment'>-- setOf :: 'Simple' 'Traversal' a 'Int' -&gt; a -&gt; 'IntSet'</span>
  61 +<a name="line-52"></a><span class='hs-comment'>-- 'setOf' :: 'Getter' a 'Int' -&gt; a -&gt; 'IntSet'</span>
  62 +<a name="line-53"></a><span class='hs-comment'>-- 'setOf' :: 'Fold' a 'Int' -&gt; a -&gt; 'IntSet'</span>
  63 +<a name="line-54"></a><span class='hs-comment'>-- 'setOf' :: 'Simple' 'Iso' a 'Int' -&gt; a -&gt; 'IntSet'</span>
  64 +<a name="line-55"></a><span class='hs-comment'>-- 'setOf' :: 'Simple' 'Lens' a 'Int' -&gt; a -&gt; 'IntSet'</span>
  65 +<a name="line-56"></a><span class='hs-comment'>-- 'setOf' :: 'Simple' 'Traversal' a 'Int' -&gt; a -&gt; 'IntSet'</span>
66 66 <a name="line-57"></a><span class='hs-comment'>-- @</span>
67 67 <a name="line-58"></a><span class='hs-definition'>setOf</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Getting</span> <span class='hs-conid'>IntSet</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-conid'>Int</span> <span class='hs-varid'>d</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>IntSet</span>
68 68 <a name="line-59"></a><span class='hs-definition'>setOf</span> <span class='hs-varid'>l</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>runAccessor</span> <span class='hs-varop'>.</span> <span class='hs-varid'>l</span> <span class='hs-layout'>(</span><span class='hs-conid'>Accessor</span> <span class='hs-varop'>.</span> <span class='hs-conid'>IntSet</span><span class='hs-varop'>.</span><span class='hs-varid'>singleton</span><span class='hs-layout'>)</span>
12 src/Data-Set-Lens.html
@@ -35,7 +35,7 @@
35 35 <a name="line-26"></a><span class='hs-comment'>-- the elements to new values.</span>
36 36 <a name="line-27"></a><span class='hs-comment'>--</span>
37 37 <a name="line-28"></a><span class='hs-comment'>-- Sadly, you can't create a valid 'Control.Lens.Traversal.Traversal' for a 'Set', but you can</span>
38   -<a name="line-29"></a><span class='hs-comment'>-- manipulate it by reading using 'folded' and reindexing it via 'setmap'.</span>
  38 +<a name="line-29"></a><span class='hs-comment'>-- manipulate it by reading using 'Control.Lens.Fold.folded' and reindexing it via 'setmapped'.</span>
39 39 <a name="line-30"></a><span class='hs-comment'>--</span>
40 40 <a name="line-31"></a><span class='hs-comment'>-- &gt;&gt;&gt; over setmapped (+1) (fromList [1,2,3,4])</span>
41 41 <a name="line-32"></a><span class='hs-comment'>-- fromList [2,3,4,5]</span>
@@ -49,11 +49,11 @@
49 49 <a name="line-40"></a><span class='hs-comment'>-- fromList [1,2,3]</span>
50 50 <a name="line-41"></a><span class='hs-comment'>--</span>
51 51 <a name="line-42"></a><span class='hs-comment'>-- @</span>
52   -<a name="line-43"></a><span class='hs-comment'>-- setOf :: 'Getter' a c -&gt; a -&gt; 'Set' c</span>
53   -<a name="line-44"></a><span class='hs-comment'>-- setOf :: 'Ord' c =&gt; 'Control.Lens.Fold.Fold' a c -&gt; a -&gt; 'Set' c</span>
54   -<a name="line-45"></a><span class='hs-comment'>-- setOf :: 'Control.Lens.Type.Simple' 'Control.Lens.Iso.Iso' a c -&gt; a -&gt; 'Set' c</span>
55   -<a name="line-46"></a><span class='hs-comment'>-- setOf :: 'Control.Lens.Type.Simple' 'Control.Lens.Type.Lens' a c -&gt; a -&gt; 'Set' c</span>
56   -<a name="line-47"></a><span class='hs-comment'>-- setOf :: 'Ord' c =&gt; 'Control.Lens.Type.Simple' 'Control.Lens.Traversal.Traversal' a c -&gt; a -&gt; 'Set' c</span>
  52 +<a name="line-43"></a><span class='hs-comment'>-- 'setOf' :: 'Getter' a c -&gt; a -&gt; 'Set' c</span>
  53 +<a name="line-44"></a><span class='hs-comment'>-- 'setOf' :: 'Ord' c =&gt; 'Control.Lens.Fold.Fold' a c -&gt; a -&gt; 'Set' c</span>
  54 +<a name="line-45"></a><span class='hs-comment'>-- 'setOf' :: 'Control.Lens.Type.Simple' 'Control.Lens.Iso.Iso' a c -&gt; a -&gt; 'Set' c</span>
  55 +<a name="line-46"></a><span class='hs-comment'>-- 'setOf' :: 'Control.Lens.Type.Simple' 'Control.Lens.Type.Lens' a c -&gt; a -&gt; 'Set' c</span>
  56 +<a name="line-47"></a><span class='hs-comment'>-- 'setOf' :: 'Ord' c =&gt; 'Control.Lens.Type.Simple' 'Control.Lens.Traversal.Traversal' a c -&gt; a -&gt; 'Set' c</span>
57 57 <a name="line-48"></a><span class='hs-comment'>-- @</span>
58 58 <a name="line-49"></a><span class='hs-definition'>setOf</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Getting</span> <span class='hs-layout'>(</span><span class='hs-conid'>Set</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span> <span class='hs-varid'>a</span> <span class='hs-varid'>b</span> <span class='hs-varid'>c</span> <span class='hs-varid'>d</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-&gt;</span> <span class='hs-conid'>Set</span> <span class='hs-varid'>c</span>
59 59 <a name="line-50"></a><span class='hs-definition'>setOf</span> <span class='hs-varid'>l</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>runAccessor</span> <span class='hs-varop'>.</span> <span class='hs-varid'>l</span> <span class='hs-layout'>(</span><span class='hs-conid'>Accessor</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Set</span><span class='hs-varop'>.</span><span class='hs-varid'>singleton</span><span class='hs-layout'>)</span>

0 comments on commit 0761b92

Please sign in to comment.
Something went wrong with that request. Please try again.