/usr/share/doc/libghc-lens-doc/html/Data-ByteString-Strict-Lens.html is in libghc-lens-doc 4.1.2.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 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 | <!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.ByteString.Strict.Lens</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Data-ByteString-Strict-Lens.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-ByteString-Strict-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.1.2.1: Lenses, Folds and Traversals</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>non-portable</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Maintainer</th><td>Edward Kmett <ekmett@gmail.com></td></tr><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Data.ByteString.Strict.Lens</p></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"><a href="#v:packedBytes">packedBytes</a> :: <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Word.html#t:Word8">Word8</a>] <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:unpackedBytes">unpackedBytes</a> :: <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Word.html#t:Word8">Word8</a>]</li><li class="src short"><a href="#v:bytes">bytes</a> :: <a href="Control-Lens-Type.html#t:IndexedTraversal-39-">IndexedTraversal'</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Word.html#t:Word8">Word8</a></li><li class="src short"><a href="#v:packedChars">packedChars</a> :: <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:unpackedChars">unpackedChars</a> :: <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:chars">chars</a> :: <a href="Control-Lens-Type.html#t:IndexedTraversal-39-">IndexedTraversal'</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Char.html#t:Char">Char</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:packedBytes" class="def">packedBytes</a> :: <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Word.html#t:Word8">Word8</a>] <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/Data-ByteString-Strict-Lens.html#packedBytes" class="link">Source</a></p><div class="doc"><p><code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:pack">pack</a></code> (or <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:unpack">unpack</a></code>) a list of bytes into a <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></code>
</p><pre>
<code><a href="Data-ByteString-Strict-Lens.html#v:packedBytes">packedBytes</a></code> ≡ <code><a href="Control-Lens-Iso.html#v:from">from</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:unpackedBytes">unpackedBytes</a></code>
<code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:pack">pack</a></code> x ≡ x <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:packedBytes">packedBytes</a></code>
<code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:unpack">unpack</a></code> x ≡ x <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> <code><a href="Control-Lens-Iso.html#v:from">from</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:packedBytes">packedBytes</a></code>
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[104,101,108,108,111]^.packedBytes
</code></strong>"hello"
</pre></div></div><div class="top"><p class="src"><a name="v:unpackedBytes" class="def">unpackedBytes</a> :: <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Word.html#t:Word8">Word8</a>]<a href="src/Data-ByteString-Strict-Lens.html#unpackedBytes" class="link">Source</a></p><div class="doc"><p><code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:unpack">unpack</a></code> (or <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:pack">pack</a></code>) a <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></code> into a list of bytes
</p><pre>
<code><a href="Data-ByteString-Strict-Lens.html#v:unpackedBytes">unpackedBytes</a></code> ≡ <code><a href="Control-Lens-Iso.html#v:from">from</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:packedBytes">packedBytes</a></code>
<code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:unpack">unpack</a></code> x ≡ x <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:unpackedBytes">unpackedBytes</a></code>
<code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:pack">pack</a></code> x ≡ x <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> <code><a href="Control-Lens-Iso.html#v:from">from</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:unpackedBytes">unpackedBytes</a></code>
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>"hello"^.packedChars.unpackedBytes
</code></strong>[104,101,108,108,111]
</pre></div></div><div class="top"><p class="src"><a name="v:bytes" class="def">bytes</a> :: <a href="Control-Lens-Type.html#t:IndexedTraversal-39-">IndexedTraversal'</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Word.html#t:Word8">Word8</a><a href="src/Data-ByteString-Strict-Lens.html#bytes" class="link">Source</a></p><div class="doc"><p>Traverse each <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Word.html#t:Word8">Word8</a></code> in a <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></code>.
</p><p>This <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> walks the <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></code> in a tree-like fashion
enable zippers to seek to locations in logarithmic time and accelerating
many monoidal queries, but up to associativity (and constant factors)
it is equivalent to the much slower:
</p><pre>
<code><a href="Data-ByteString-Strict-Lens.html#v:bytes">bytes</a></code> ≡ <code><a href="Data-ByteString-Strict-Lens.html#v:unpackedBytes">unpackedBytes</a></code> <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#v:.">.</a></code> <code><a href="Control-Lens-Traversal.html#v:traversed">traversed</a></code>
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>anyOf bytes (== 0x80) (Char8.pack "hello")
</code></strong>False
</pre><p>Note that when just using this as a <code><a href="Control-Lens-Type.html#t:Setter">Setter</a></code>, <code><code><a href="Control-Lens-Setter.html#v:setting">setting</a></code> <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:map">map</a></code></code>
can be more efficient.
</p></div></div><div class="top"><p class="src"><a name="v:packedChars" class="def">packedChars</a> :: <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/Data-ByteString-Strict-Lens.html#packedChars" class="link">Source</a></p><div class="doc"><p><code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Char8.html#t:pack">pack</a></code> (or <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Char8.html#t:unpack">unpack</a></code>) a list of characters into a <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></code>
</p><p>When writing back to the <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></code> it is assumed that every <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Char.html#t:Char">Char</a></code>
lies between <code>'\x00'</code> and <code>'\xff'</code>.
</p><pre>
<code><a href="Data-ByteString-Strict-Lens.html#v:packedChars">packedChars</a></code> ≡ <code><a href="Control-Lens-Iso.html#v:from">from</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:unpackedChars">unpackedChars</a></code>
<code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Char8.html#t:pack">pack</a></code> x ≡ x <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:packedChars">packedChars</a></code>
<code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Char8.html#t:unpack">unpack</a></code> x ≡ x <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> <code><a href="Control-Lens-Iso.html#v:from">from</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:packedChars">packedChars</a></code>
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>"hello"^.packedChars.each.re (base 16 . enum).to (\x -> if Prelude.length x == 1 then '0':x else x)
</code></strong>"68656c6c6f"
</pre></div></div><div class="top"><p class="src"><a name="v:unpackedChars" class="def">unpackedChars</a> :: <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a><a href="src/Data-ByteString-Strict-Lens.html#unpackedChars" class="link">Source</a></p><div class="doc"><p><code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Char8.html#t:unpack">unpack</a></code> (or <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Char8.html#t:pack">pack</a></code>) a list of characters into a <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></code>
</p><p>When writing back to the <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></code> it is assumed that every <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Char.html#t:Char">Char</a></code>
lies between <code>'\x00'</code> and <code>'\xff'</code>.
</p><pre>
<code><a href="Data-ByteString-Strict-Lens.html#v:unpackedChars">unpackedChars</a></code> ≡ <code><a href="Control-Lens-Iso.html#v:from">from</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:packedChars">packedChars</a></code>
<code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Char8.html#t:unpack">unpack</a></code> x ≡ x <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:unpackedChars">unpackedChars</a></code>
<code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Char8.html#t:pack">pack</a></code> x ≡ x <code><a href="Control-Lens-Getter.html#v:-94-.">^.</a></code> <code><a href="Control-Lens-Iso.html#v:from">from</a></code> <code><a href="Data-ByteString-Strict-Lens.html#v:unpackedChars">unpackedChars</a></code>
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>[104,101,108,108,111]^.packedBytes.unpackedChars
</code></strong>"hello"
</pre></div></div><div class="top"><p class="src"><a name="v:chars" class="def">chars</a> :: <a href="Control-Lens-Type.html#t:IndexedTraversal-39-">IndexedTraversal'</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Char.html#t:Char">Char</a><a href="src/Data-ByteString-Strict-Lens.html#chars" class="link">Source</a></p><div class="doc"><p>Traverse the individual bytes in a <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></code> as characters.
</p><p>When writing back to the <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></code> it is assumed that every <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Char.html#t:Char">Char</a></code>
lies between <code>'\x00'</code> and <code>'\xff'</code>.
</p><p>This <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> walks the <code><a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></code> in a tree-like fashion
enable zippers to seek to locations in logarithmic time and accelerating
many monoidal queries, but up to associativity (and constant factors)
it is equivalent to the much slower:
</p><pre>
<code><a href="Data-ByteString-Strict-Lens.html#v:chars">chars</a></code> = <code><a href="Data-ByteString-Strict-Lens.html#v:unpackedChars">unpackedChars</a></code> <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#v:.">.</a></code> <code><a href="Control-Lens-Traversal.html#v:traverse">traverse</a></code>
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>anyOf chars (== 'h') "hello"
</code></strong>True
</pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|