This file is indexed.

/usr/share/doc/libghc-lens-doc/html/Data-Vector-Generic-Lens.html is in libghc-lens-doc 4.15.4-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
<!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>Data.Vector.Generic.Lens</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Data-Vector-Generic-Lens.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Vector-Generic-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-4.15.4: Lenses, Folds and Traversals</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>(C) 2012-2016 Edward Kmett</td></tr><tr><th>License</th><td>BSD-style (see the file LICENSE)</td></tr><tr><th>Maintainer</th><td>Edward Kmett &lt;ekmett@gmail.com&gt;</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Portability</th><td>non-portable</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Data.Vector.Generic.Lens</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Isomorphisms</a></li><li><a href="#g:2">Lenses</a></li><li><a href="#g:3">Traversal of individual indices</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module provides lenses and traversals for working with generic
 vectors.</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"><a href="#v:toVectorOf">toVectorOf</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a =&gt; <a href="Control-Lens-Getter.html#t:Getting">Getting</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Monoid.html#t:Endo">Endo</a> [a]) s a -&gt; s -&gt; v a</li><li class="src short"><a href="#v:forced">forced</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a =&gt; <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> (v a) (v a)</li><li class="src short"><a href="#v:vector">vector</a> :: (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v b) =&gt; <a href="Control-Lens-Type.html#t:Iso">Iso</a> [a] [b] (v a) (v b)</li><li class="src short"><a href="#v:asStream">asStream</a> :: (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v b) =&gt; <a href="Control-Lens-Type.html#t:Iso">Iso</a> (v a) (v b) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Fusion-Bundle.html#t:Bundle">Bundle</a> v a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Fusion-Bundle.html#t:Bundle">Bundle</a> v b)</li><li class="src short"><a href="#v:asStreamR">asStreamR</a> :: (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v b) =&gt; <a href="Control-Lens-Type.html#t:Iso">Iso</a> (v a) (v b) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Fusion-Bundle.html#t:Bundle">Bundle</a> v a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Fusion-Bundle.html#t:Bundle">Bundle</a> v b)</li><li class="src short"><a href="#v:cloned">cloned</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a =&gt; <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> (v a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic-New.html#t:New">New</a> v a)</li><li class="src short"><a href="#v:converted">converted</a> :: (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> w a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v b, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> w b) =&gt; <a href="Control-Lens-Type.html#t:Iso">Iso</a> (v a) (v b) (w a) (w b)</li><li class="src short"><a href="#v:sliced">sliced</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> (v a) (v a)</li><li class="src short"><a href="#v:ordinals">ordinals</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a =&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a>] -&gt; <a href="Control-Lens-Type.html#t:IndexedTraversal-39-">IndexedTraversal'</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> (v a) a</li><li class="src short"><a href="#v:vectorIx">vectorIx</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> (v a) a</li><li class="src short"><a href="#v:vectorTraverse">vectorTraverse</a> :: (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> w b) =&gt; <a href="Control-Lens-Type.html#t:IndexedTraversal">IndexedTraversal</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> (v a) (w b) a b</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a id="v:toVectorOf" class="def">toVectorOf</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a =&gt; <a href="Control-Lens-Getter.html#t:Getting">Getting</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Monoid.html#t:Endo">Endo</a> [a]) s a -&gt; s -&gt; v a <a href="src/Data-Vector-Generic-Lens.html#toVectorOf" class="link">Source</a> <a href="#v:toVectorOf" class="selflink">#</a></p><div class="doc"><p>Similar to <code><a href="Control-Lens-Fold.html#v:toListOf">toListOf</a></code>, but returning a <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a></code>.</p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>(toVectorOf both (8,15) :: Vector.Vector Int) == Vector.fromList [8,15]
</code></strong>True
</pre></div></div><h1 id="g:1">Isomorphisms</h1><div class="top"><p class="src"><a id="v:forced" class="def">forced</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a =&gt; <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> (v a) (v a) <a href="src/Data-Vector-Generic-Lens.html#forced" class="link">Source</a> <a href="#v:forced" class="selflink">#</a></p><div class="doc"><p>Convert a <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a></code> to a version that doesn't retain any extra
 memory.</p></div></div><div class="top"><p class="src"><a id="v:vector" class="def">vector</a> :: (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v b) =&gt; <a href="Control-Lens-Type.html#t:Iso">Iso</a> [a] [b] (v a) (v b) <a href="src/Data-Vector-Generic-Lens.html#vector" class="link">Source</a> <a href="#v:vector" class="selflink">#</a></p><div class="doc"><p>Convert a list to a <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a></code> (or back.)</p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>([1,2,3] ^. vector :: Vector.Vector Int) == Vector.fromList [1,2,3]
</code></strong>True
</pre><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>Vector.fromList [0,8,15] ^. from vector
</code></strong>[0,8,15]
</pre></div></div><div class="top"><p class="src"><a id="v:asStream" class="def">asStream</a> :: (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v b) =&gt; <a href="Control-Lens-Type.html#t:Iso">Iso</a> (v a) (v b) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Fusion-Bundle.html#t:Bundle">Bundle</a> v a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Fusion-Bundle.html#t:Bundle">Bundle</a> v b) <a href="src/Data-Vector-Generic-Lens.html#asStream" class="link">Source</a> <a href="#v:asStream" class="selflink">#</a></p><div class="doc"><p>Convert a <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a></code> to a finite <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Fusion-Bundle.html#t:Bundle">Bundle</a></code> (or back.)</p></div></div><div class="top"><p class="src"><a id="v:asStreamR" class="def">asStreamR</a> :: (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v b) =&gt; <a href="Control-Lens-Type.html#t:Iso">Iso</a> (v a) (v b) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Fusion-Bundle.html#t:Bundle">Bundle</a> v a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Fusion-Bundle.html#t:Bundle">Bundle</a> v b) <a href="src/Data-Vector-Generic-Lens.html#asStreamR" class="link">Source</a> <a href="#v:asStreamR" class="selflink">#</a></p><div class="doc"><p>Convert a <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a></code> to a finite <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Fusion-Bundle.html#t:Bundle">Bundle</a></code> from right to left (or
 back.)</p></div></div><div class="top"><p class="src"><a id="v:cloned" class="def">cloned</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a =&gt; <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> (v a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic-New.html#t:New">New</a> v a) <a href="src/Data-Vector-Generic-Lens.html#cloned" class="link">Source</a> <a href="#v:cloned" class="selflink">#</a></p><div class="doc"><p>Convert a <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a></code> back and forth to an initializer that when run
 produces a copy of the <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:converted" class="def">converted</a> :: (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> w a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v b, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> w b) =&gt; <a href="Control-Lens-Type.html#t:Iso">Iso</a> (v a) (v b) (w a) (w b) <a href="src/Data-Vector-Generic-Lens.html#converted" class="link">Source</a> <a href="#v:converted" class="selflink">#</a></p><div class="doc"><p>Different vector implementations are isomorphic to each other.</p></div></div><h1 id="g:2">Lenses</h1><div class="top"><p class="src"><a id="v:sliced" class="def">sliced</a> <a href="src/Data-Vector-Generic-Lens.html#sliced" class="link">Source</a> <a href="#v:sliced" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></td><td class="doc"><p><code>i</code> starting index</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></td><td class="doc"><p><code>n</code> length</p></td></tr><tr><td class="src">-&gt; <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> (v a) (v a)</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p><code>sliced i n</code> provides a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> that edits the <code>n</code> elements starting
 at index <code>i</code> from a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>.</p><p>This is only a valid <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> if you do not change the length of the
 resulting <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a></code>.</p><p>Attempting to return a longer or shorter vector will result in
 violations of the <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> laws.</p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>Vector.fromList [1..10] ^. sliced 2 5 == Vector.fromList [3,4,5,6,7]
</code></strong>True
</pre><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>(Vector.fromList [1..10] &amp; sliced 2 5 . mapped .~ 0) == Vector.fromList [1,2,0,0,0,0,0,8,9,10]
</code></strong>True
</pre></div></div><h1 id="g:3">Traversal of individual indices</h1><div class="top"><p class="src"><a id="v:ordinals" class="def">ordinals</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a =&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a>] -&gt; <a href="Control-Lens-Type.html#t:IndexedTraversal-39-">IndexedTraversal'</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> (v a) a <a href="src/Data-Vector-Generic-Lens.html#ordinals" class="link">Source</a> <a href="#v:ordinals" class="selflink">#</a></p><div class="doc"><p>This <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> will ignore any duplicates in the supplied list
 of indices.</p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>toListOf (ordinals [1,3,2,5,9,10]) $ Vector.fromList [2,4..40]
</code></strong>[4,8,6,12,20,22]
</pre></div></div><div class="top"><p class="src"><a id="v:vectorIx" class="def">vectorIx</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> (v a) a <a href="src/Data-Vector-Generic-Lens.html#vectorIx" class="link">Source</a> <a href="#v:vectorIx" class="selflink">#</a></p><div class="doc"><p>Like <code>ix</code> but polymorphic in the vector type.</p></div></div><div class="top"><p class="src"><a id="v:vectorTraverse" class="def">vectorTraverse</a> :: (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> v a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Generic.html#t:Vector">Vector</a> w b) =&gt; <a href="Control-Lens-Type.html#t:IndexedTraversal">IndexedTraversal</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> (v a) (w b) a b <a href="src/Data-Vector-Generic-Lens.html#vectorTraverse" class="link">Source</a> <a href="#v:vectorTraverse" class="selflink">#</a></p><div class="doc"><p>Indexed vector traversal for a generic vector.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>