/usr/share/doc/libghc-lens-doc/html/Control-Lens-Cons.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 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Control.Lens.Cons</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Control-Lens-Cons.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Lens-Cons.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-16 Edward Kmett</td></tr><tr><th>License</th><td>BSD-style (see the file LICENSE)</td></tr><tr><th>Maintainer</th><td>Edward Kmett <ekmett@gmail.com></td></tr><tr><th>Stability</th><td>experimental</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">Control.Lens.Cons</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Cons</a></li><li><a href="#g:2">Snoc</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc empty"> </div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">class</span> <a href="#t:Cons">Cons</a> s t a b | s -> a, t -> b, s b -> t, t a -> s <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><a href="#v:-60--124-">(<|)</a> :: <a href="Control-Lens-Cons.html#t:Cons">Cons</a> s s a a => a -> s -> s</li><li class="src short"><a href="#v:cons">cons</a> :: <a href="Control-Lens-Cons.html#t:Cons">Cons</a> s s a a => a -> s -> s</li><li class="src short"><a href="#v:uncons">uncons</a> :: <a href="Control-Lens-Cons.html#t:Cons">Cons</a> s s a a => s -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (a, s)</li><li class="src short"><a href="#v:_head">_head</a> :: <a href="Control-Lens-Cons.html#t:Cons">Cons</a> s s a a => <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> s a</li><li class="src short"><a href="#v:_tail">_tail</a> :: <a href="Control-Lens-Cons.html#t:Cons">Cons</a> s s a a => <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> s s</li><li class="src short"><span class="keyword">pattern</span> <a href="#v::-60-">(:<)</a> :: <span class="keyword">forall</span> t t1. <a href="Control-Lens-Cons.html#t:Cons">Cons</a> t1 t1 t t => t -> t1 -> t1</li><li class="src short"><span class="keyword">class</span> <a href="#t:Snoc">Snoc</a> s t a b | s -> a, t -> b, s b -> t, t a -> s <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><a href="#v:-124--62-">(|>)</a> :: <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> s s a a => s -> a -> s</li><li class="src short"><a href="#v:snoc">snoc</a> :: <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> s s a a => s -> a -> s</li><li class="src short"><a href="#v:unsnoc">unsnoc</a> :: <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> s s a a => s -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (s, a)</li><li class="src short"><a href="#v:_init">_init</a> :: <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> s s a a => <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> s s</li><li class="src short"><a href="#v:_last">_last</a> :: <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> s s a a => <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> s a</li><li class="src short"><span class="keyword">pattern</span> <a href="#v::-62-">(:>)</a> :: <span class="keyword">forall</span> t t1. <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> t1 t1 t t => t1 -> t -> t1</li></ul></div><div id="interface"><h1 id="g:1">Cons</h1><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:Cons" class="def">Cons</a> s t a b | s -> a, t -> b, s b -> t, t a -> s <span class="keyword">where</span> <a href="src/Control-Lens-Cons.html#Cons" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></p><div class="doc"><p>This class provides a way to attach or detach elements on the left
side of a structure in a flexible manner.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:_Cons" class="def">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> s t (a, s) (b, t) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p><div class="doc"><pre><code><a href="Control-Lens-Cons.html#v:_Cons">_Cons</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism">Prism</a></code> [a] [b] (a, [a]) (b, [b])
<code><a href="Control-Lens-Cons.html#v:_Cons">_Cons</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism">Prism</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> a) (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> b) (a, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> a) (b, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> b)
<code><a href="Control-Lens-Cons.html#v:_Cons">_Cons</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism">Prism</a></code> (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> a) (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> b) (a, <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> a) (b, <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> b)
<code><a href="Control-Lens-Cons.html#v:_Cons">_Cons</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism-39-">Prism'</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></code>, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code>)
<code><a href="Control-Lens-Cons.html#v:_Cons">_Cons</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism-39-">Prism'</a></code> <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></code>, <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code>)
<code><a href="Control-Lens-Cons.html#v:_Cons">_Cons</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism-39-">Prism'</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a></code>, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>)
</pre></div></div><div class="subs instances"><p id="control.i:Cons" class="caption collapser" onclick="toggleSection('i:Cons')">Instances</p><div id="section.i:Cons" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Cons:Cons:1" class="instance expander" onclick="toggleSection('i:ic:Cons:Cons:1')"></span> <a href="Control-Lens-Cons.html#t:Cons">Cons</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a></span> <a href="src/Control-Lens-Cons.html#line-134" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Cons:Cons:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Cons">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Cons:Cons:2" class="instance expander" onclick="toggleSection('i:ic:Cons:Cons:2')"></span> <a href="Control-Lens-Cons.html#t:Cons">Cons</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a></span> <a href="src/Control-Lens-Cons.html#line-130" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Cons:Cons:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Cons">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Cons:Cons:3" class="instance expander" onclick="toggleSection('i:ic:Cons:Cons:3')"></span> <a href="Control-Lens-Cons.html#t:Cons">Cons</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></span> <a href="src/Control-Lens-Cons.html#line-142" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Cons:Cons:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Cons">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>, <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a>) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>, <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a>) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Cons:Cons:4" class="instance expander" onclick="toggleSection('i:ic:Cons:Cons:4')"></span> <a href="Control-Lens-Cons.html#t:Cons">Cons</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></span> <a href="src/Control-Lens-Cons.html#line-138" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Cons:Cons:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Cons">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>, <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a>) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>, <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a>) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Cons:Cons:5" class="instance expander" onclick="toggleSection('i:ic:Cons:Cons:5')"></span> <a href="Control-Lens-Cons.html#t:Cons">Cons</a> [a] [b] a b</span> <a href="src/Control-Lens-Cons.html#line-118" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Cons:Cons:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Cons">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> [a] [b] (a, [a]) (b, [b]) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Cons:Cons:6" class="instance expander" onclick="toggleSection('i:ic:Cons:Cons:6')"></span> <a href="Control-Lens-Cons.html#t:Cons">Cons</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> a) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-124" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Cons:Cons:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Cons">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> a) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> b) (a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> a) (b, <a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> b) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Cons:Cons:7" class="instance expander" onclick="toggleSection('i:ic:Cons:Cons:7')"></span> <a href="Control-Lens-Cons.html#t:Cons">Cons</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-146" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Cons:Cons:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Cons">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> b) (a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> a) (b, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> b) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Cons:Cons:8" class="instance expander" onclick="toggleSection('i:ic:Cons:Cons:8')"></span> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Foreign-Storable.html#t:Storable">Storable</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Foreign-Storable.html#t:Storable">Storable</a> b) => <a href="Control-Lens-Cons.html#t:Cons">Cons</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-160" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Cons:Cons:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Cons">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> b) (a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> a) (b, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> b) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Cons:Cons:9" class="instance expander" onclick="toggleSection('i:ic:Cons:Cons:9')"></span> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed-Mutable.html#t:Unbox">Unbox</a> a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed-Mutable.html#t:Unbox">Unbox</a> b) => <a href="Control-Lens-Cons.html#t:Cons">Cons</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-167" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Cons:Cons:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Cons">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> b) (a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> a) (b, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> b) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Cons:Cons:10" class="instance expander" onclick="toggleSection('i:ic:Cons:Cons:10')"></span> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive-Mutable.html#t:Prim">Prim</a> a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive-Mutable.html#t:Prim">Prim</a> b) => <a href="Control-Lens-Cons.html#t:Cons">Cons</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-153" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Cons:Cons:10" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Cons">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> b) (a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> a) (b, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> b) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Cons:Cons:11" class="instance expander" onclick="toggleSection('i:ic:Cons:Cons:11')"></span> <a href="Control-Lens-Cons.html#t:Cons">Cons</a> (<a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> a) (<a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-195" class="link">Source</a> <a href="#t:Cons" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Cons:Cons:11" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Cons">_Cons</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> a) (<a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> b) (a, <a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> a) (b, <a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> b) <a href="src/Control-Lens-Cons.html#_Cons" class="link">Source</a> <a href="#v:_Cons" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:-60--124-" class="def">(<|)</a> :: <a href="Control-Lens-Cons.html#t:Cons">Cons</a> s s a a => a -> s -> s <span class="fixity">infixr 5</span><span class="rightedge"></span> <a href="src/Control-Lens-Cons.html#%3C%7C" class="link">Source</a> <a href="#v:-60--124-" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Lens-Cons.html#v:cons">cons</a></code> an element onto a container.</p><p>This is an infix alias for <code><a href="Control-Lens-Cons.html#v:cons">cons</a></code>.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>a <| []
</code></strong>[a]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>a <| [b, c]
</code></strong>[a,b,c]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>a <| Seq.fromList []
</code></strong>fromList [a]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>a <| Seq.fromList [b, c]
</code></strong>fromList [a,b,c]
</pre></div></div><div class="top"><p class="src"><a id="v:cons" class="def">cons</a> :: <a href="Control-Lens-Cons.html#t:Cons">Cons</a> s s a a => a -> s -> s <span class="fixity">infixr 5</span><span class="rightedge"></span> <a href="src/Control-Lens-Cons.html#cons" class="link">Source</a> <a href="#v:cons" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Lens-Cons.html#v:cons">cons</a></code> an element onto a container.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>cons a []
</code></strong>[a]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>cons a [b, c]
</code></strong>[a,b,c]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>cons a (Seq.fromList [])
</code></strong>fromList [a]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>cons a (Seq.fromList [b, c])
</code></strong>fromList [a,b,c]
</pre></div></div><div class="top"><p class="src"><a id="v:uncons" class="def">uncons</a> :: <a href="Control-Lens-Cons.html#t:Cons">Cons</a> s s a a => s -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (a, s) <a href="src/Control-Lens-Cons.html#uncons" class="link">Source</a> <a href="#v:uncons" class="selflink">#</a></p><div class="doc"><p>Attempt to extract the left-most element from a container, and a version of the container without that element.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>uncons []
</code></strong>Nothing
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>uncons [a, b, c]
</code></strong>Just (a,[b,c])
</pre></div></div><div class="top"><p class="src"><a id="v:_head" class="def">_head</a> :: <a href="Control-Lens-Cons.html#t:Cons">Cons</a> s s a a => <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> s a <a href="src/Control-Lens-Cons.html#_head" class="link">Source</a> <a href="#v:_head" class="selflink">#</a></p><div class="doc"><p>A <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> reading and writing to the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-OldList.html#v:head">head</a></code> of a <em>non-empty</em> container.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[a,b,c]^? _head
</code></strong>Just a
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[a,b,c] & _head .~ d
</code></strong>[d,b,c]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[a,b,c] & _head %~ f
</code></strong>[f a,b,c]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[] & _head %~ f
</code></strong>[]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[1,2,3]^?!_head
</code></strong>1
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[]^?_head
</code></strong>Nothing
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[1,2]^?_head
</code></strong>Just 1
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[] & _head .~ 1
</code></strong>[]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[0] & _head .~ 2
</code></strong>[2]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[0,1] & _head .~ 2
</code></strong>[2,1]
</pre><p>This isn't limited to lists.</p><p>For instance you can also <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Traversable.html#v:traverse">traverse</a></code> the head of a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code>:</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>Seq.fromList [a,b,c,d] & _head %~ f
</code></strong>fromList [f a,b,c,d]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>Seq.fromList [] ^? _head
</code></strong>Nothing
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>Seq.fromList [a,b,c,d] ^? _head
</code></strong>Just a
</pre><pre><code><a href="Control-Lens-Cons.html#v:_head">_head</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> [a] a
<code><a href="Control-Lens-Cons.html#v:_head">_head</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> a) a
<code><a href="Control-Lens-Cons.html#v:_head">_head</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> a) a
</pre></div></div><div class="top"><p class="src"><a id="v:_tail" class="def">_tail</a> :: <a href="Control-Lens-Cons.html#t:Cons">Cons</a> s s a a => <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> s s <a href="src/Control-Lens-Cons.html#_tail" class="link">Source</a> <a href="#v:_tail" class="selflink">#</a></p><div class="doc"><p>A <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> reading and writing to the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-OldList.html#v:tail">tail</a></code> of a <em>non-empty</em> container.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[a,b] & _tail .~ [c,d,e]
</code></strong>[a,c,d,e]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[] & _tail .~ [a,b]
</code></strong>[]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[a,b,c,d,e] & _tail.traverse %~ f
</code></strong>[a,f b,f c,f d,f e]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[1,2] & _tail .~ [3,4,5]
</code></strong>[1,3,4,5]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[] & _tail .~ [1,2]
</code></strong>[]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[a,b,c]^?_tail
</code></strong>Just [b,c]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[1,2]^?!_tail
</code></strong>[2]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>"hello"^._tail
</code></strong>"ello"
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>""^._tail
</code></strong>""
</pre><p>This isn't limited to lists. For instance you can also <code><a href="Control-Traversable.html#v:traverse">traverse</a></code> the tail of a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code>.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>Seq.fromList [a,b] & _tail .~ Seq.fromList [c,d,e]
</code></strong>fromList [a,c,d,e]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>Seq.fromList [a,b,c] ^? _tail
</code></strong>Just (fromList [b,c])
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>Seq.fromList [] ^? _tail
</code></strong>Nothing
</pre><pre><code><a href="Control-Lens-Cons.html#v:_tail">_tail</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> [a] [a]
<code><a href="Control-Lens-Cons.html#v:_tail">_tail</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> a) (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> a)
<code><a href="Control-Lens-Cons.html#v:_tail">_tail</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> a) (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> a)
</pre></div></div><div class="top"><p class="src"><span class="keyword">pattern</span> <a id="v::-60-" class="def">(:<)</a> :: <span class="keyword">forall</span> t t1. <a href="Control-Lens-Cons.html#t:Cons">Cons</a> t1 t1 t t => t -> t1 -> t1 <span class="fixity">infixr 5</span><span class="rightedge"></span> <a href="src/Control-Lens-Cons.html#%3A%3C" class="link">Source</a> <a href="#v::-60-" class="selflink">#</a></p></div><h1 id="g:2">Snoc</h1><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:Snoc" class="def">Snoc</a> s t a b | s -> a, t -> b, s b -> t, t a -> s <span class="keyword">where</span> <a href="src/Control-Lens-Cons.html#Snoc" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></p><div class="doc"><p>This class provides a way to attach or detach elements on the right
side of a structure in a flexible manner.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:_Snoc" class="def">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> s t (s, a) (t, b) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p><div class="doc"><pre><code><a href="Control-Lens-Cons.html#v:_Snoc">_Snoc</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism">Prism</a></code> [a] [b] ([a], a) ([b], b)
<code><a href="Control-Lens-Cons.html#v:_Snoc">_Snoc</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism">Prism</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> a) (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> b) (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> a, a) (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> b, b)
<code><a href="Control-Lens-Cons.html#v:_Snoc">_Snoc</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism">Prism</a></code> (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> a) (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> b) (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> a, a) (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> b, b)
<code><a href="Control-Lens-Cons.html#v:_Snoc">_Snoc</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism-39-">Prism'</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code>, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></code>)
<code><a href="Control-Lens-Cons.html#v:_Snoc">_Snoc</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism-39-">Prism'</a></code> <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code> (<code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code>, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></code>)
<code><a href="Control-Lens-Cons.html#v:_Snoc">_Snoc</a></code> :: <code><a href="Control-Lens-Type.html#t:Prism-39-">Prism'</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a></code>)
</pre></div></div><div class="subs instances"><p id="control.i:Snoc" class="caption collapser" onclick="toggleSection('i:Snoc')">Instances</p><div id="section.i:Snoc" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Snoc:Snoc:1" class="instance expander" onclick="toggleSection('i:ic:Snoc:Snoc:1')"></span> <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a></span> <a href="src/Control-Lens-Cons.html#line-385" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Snoc:Snoc:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Snoc">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a>) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a>) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Snoc:Snoc:2" class="instance expander" onclick="toggleSection('i:ic:Snoc:Snoc:2')"></span> <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a></span> <a href="src/Control-Lens-Cons.html#line-379" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Snoc:Snoc:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Snoc">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a>) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a>) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Snoc:Snoc:3" class="instance expander" onclick="toggleSection('i:ic:Snoc:Snoc:3')"></span> <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></span> <a href="src/Control-Lens-Cons.html#line-397" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Snoc:Snoc:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Snoc">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> (<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>) (<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Snoc:Snoc:4" class="instance expander" onclick="toggleSection('i:ic:Snoc:Snoc:4')"></span> <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></span> <a href="src/Control-Lens-Cons.html#line-391" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Snoc:Snoc:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Snoc">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> (<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>) (<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Snoc:Snoc:5" class="instance expander" onclick="toggleSection('i:ic:Snoc:Snoc:5')"></span> <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> [a] [b] a b</span> <a href="src/Control-Lens-Cons.html#line-343" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Snoc:Snoc:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Snoc">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> [a] [b] ([a], a) ([b], b) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Snoc:Snoc:6" class="instance expander" onclick="toggleSection('i:ic:Snoc:Snoc:6')"></span> <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> a) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-349" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Snoc:Snoc:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Snoc">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> a) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> b) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> a, a) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a> b, b) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Snoc:Snoc:7" class="instance expander" onclick="toggleSection('i:ic:Snoc:Snoc:7')"></span> <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-355" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Snoc:Snoc:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Snoc">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> b) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> a, a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> b, b) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Snoc:Snoc:8" class="instance expander" onclick="toggleSection('i:ic:Snoc:Snoc:8')"></span> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Foreign-Storable.html#t:Storable">Storable</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Foreign-Storable.html#t:Storable">Storable</a> b) => <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-367" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Snoc:Snoc:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Snoc">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> b) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> a, a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Storable.html#t:Vector">Vector</a> b, b) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Snoc:Snoc:9" class="instance expander" onclick="toggleSection('i:ic:Snoc:Snoc:9')"></span> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed-Mutable.html#t:Unbox">Unbox</a> a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed-Mutable.html#t:Unbox">Unbox</a> b) => <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-373" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Snoc:Snoc:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Snoc">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> b) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> a, a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> b, b) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Snoc:Snoc:10" class="instance expander" onclick="toggleSection('i:ic:Snoc:Snoc:10')"></span> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive-Mutable.html#t:Prim">Prim</a> a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive-Mutable.html#t:Prim">Prim</a> b) => <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-361" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Snoc:Snoc:10" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Snoc">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> b) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> a, a) (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Primitive.html#t:Vector">Vector</a> b, b) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Snoc:Snoc:11" class="instance expander" onclick="toggleSection('i:ic:Snoc:Snoc:11')"></span> <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> (<a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> a) (<a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> b) a b</span> <a href="src/Control-Lens-Cons.html#line-204" class="link">Source</a> <a href="#t:Snoc" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:Snoc:Snoc:11" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:_Snoc">_Snoc</a> :: <a href="Control-Lens-Type.html#t:Prism">Prism</a> (<a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> a) (<a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> b) (<a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> a, a) (<a href="Control-Lens-Internal-Deque.html#t:Deque">Deque</a> b, b) <a href="src/Control-Lens-Cons.html#_Snoc" class="link">Source</a> <a href="#v:_Snoc" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:-124--62-" class="def">(|>)</a> :: <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> s s a a => s -> a -> s <span class="fixity">infixl 5</span><span class="rightedge"></span> <a href="src/Control-Lens-Cons.html#%7C%3E" class="link">Source</a> <a href="#v:-124--62-" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Lens-Cons.html#v:snoc">snoc</a></code> an element onto the end of a container.</p><p>This is an infix alias for <code><a href="Control-Lens-Cons.html#v:snoc">snoc</a></code>.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>Seq.fromList [] |> a
</code></strong>fromList [a]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>Seq.fromList [b, c] |> a
</code></strong>fromList [b,c,a]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>LazyT.pack "hello" |> '!'
</code></strong>"hello!"
</pre></div></div><div class="top"><p class="src"><a id="v:snoc" class="def">snoc</a> :: <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> s s a a => s -> a -> s <span class="fixity">infixl 5</span><span class="rightedge"></span> <a href="src/Control-Lens-Cons.html#snoc" class="link">Source</a> <a href="#v:snoc" class="selflink">#</a></p><div class="doc"><p><code><a href="Control-Lens-Cons.html#v:snoc">snoc</a></code> an element onto the end of a container.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>snoc (Seq.fromList []) a
</code></strong>fromList [a]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>snoc (Seq.fromList [b, c]) a
</code></strong>fromList [b,c,a]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>snoc (LazyT.pack "hello") '!'
</code></strong>"hello!"
</pre></div></div><div class="top"><p class="src"><a id="v:unsnoc" class="def">unsnoc</a> :: <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> s s a a => s -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (s, a) <a href="src/Control-Lens-Cons.html#unsnoc" class="link">Source</a> <a href="#v:unsnoc" class="selflink">#</a></p><div class="doc"><p>Attempt to extract the right-most element from a container, and a version of the container without that element.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>unsnoc (LazyT.pack "hello!")
</code></strong>Just ("hello",'!')
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>unsnoc (LazyT.pack "")
</code></strong>Nothing
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>unsnoc (Seq.fromList [b,c,a])
</code></strong>Just (fromList [b,c],a)
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>unsnoc (Seq.fromList [])
</code></strong>Nothing
</pre></div></div><div class="top"><p class="src"><a id="v:_init" class="def">_init</a> :: <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> s s a a => <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> s s <a href="src/Control-Lens-Cons.html#_init" class="link">Source</a> <a href="#v:_init" class="selflink">#</a></p><div class="doc"><p>A <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> reading and replacing all but the a last element of a <em>non-empty</em> container.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[a,b,c,d]^?_init
</code></strong>Just [a,b,c]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[]^?_init
</code></strong>Nothing
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[a,b] & _init .~ [c,d,e]
</code></strong>[c,d,e,b]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[] & _init .~ [a,b]
</code></strong>[]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[a,b,c,d] & _init.traverse %~ f
</code></strong>[f a,f b,f c,d]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[1,2,3]^?_init
</code></strong>Just [1,2]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[1,2,3,4]^?!_init
</code></strong>[1,2,3]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>"hello"^._init
</code></strong>"hell"
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>""^._init
</code></strong>""
</pre><pre><code><a href="Control-Lens-Cons.html#v:_init">_init</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> [a] [a]
<code><a href="Control-Lens-Cons.html#v:_init">_init</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> a) (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> a)
<code><a href="Control-Lens-Cons.html#v:_init">_init</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> a) (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> a)
</pre></div></div><div class="top"><p class="src"><a id="v:_last" class="def">_last</a> :: <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> s s a a => <a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a> s a <a href="src/Control-Lens-Cons.html#_last" class="link">Source</a> <a href="#v:_last" class="selflink">#</a></p><div class="doc"><p>A <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> reading and writing to the last element of a <em>non-empty</em> container.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[a,b,c]^?!_last
</code></strong>c
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[]^?_last
</code></strong>Nothing
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[a,b,c] & _last %~ f
</code></strong>[a,b,f c]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[1,2]^?_last
</code></strong>Just 2
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[] & _last .~ 1
</code></strong>[]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[0] & _last .~ 2
</code></strong>[2]
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[0,1] & _last .~ 2
</code></strong>[0,2]
</pre><p>This <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> is not limited to lists, however. We can also work with other containers, such as a <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code>.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>Vector.fromList "abcde" ^? _last
</code></strong>Just 'e'
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>Vector.empty ^? _last
</code></strong>Nothing
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(Vector.fromList "abcde" & _last .~ 'Q') == Vector.fromList "abcdQ"
</code></strong>True
</pre><pre><code><a href="Control-Lens-Cons.html#v:_last">_last</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> [a] a
<code><a href="Control-Lens-Cons.html#v:_last">_last</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Sequence.html#t:Seq">Seq</a></code> a) a
<code><a href="Control-Lens-Cons.html#v:_last">_last</a></code> :: <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> (<code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a></code> a) a
</pre></div></div><div class="top"><p class="src"><span class="keyword">pattern</span> <a id="v::-62-" class="def">(:>)</a> :: <span class="keyword">forall</span> t t1. <a href="Control-Lens-Cons.html#t:Snoc">Snoc</a> t1 t1 t t => t1 -> t -> t1 <span class="fixity">infixl 5</span><span class="rightedge"></span> <a href="src/Control-Lens-Cons.html#%3A%3E" class="link">Source</a> <a href="#v::-62-" class="selflink">#</a></p></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>
|