This file is indexed.

/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html is in libghc-text-doc 1.2.2.2-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
<!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.Text.Internal</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-Text-Internal.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Text-Internal.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">text-1.2.2.2: An efficient packed Unicode text type.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>(c) 2008 2009 Tom Harper<br />(c) 2009 2010 Bryan O'Sullivan<br />(c) 2009 Duncan Coutts</td></tr><tr><th>License</th><td>BSD-style</td></tr><tr><th>Maintainer</th><td>bos@serpentine.com</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Portability</th><td>GHC</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Data.Text.Internal</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Types</a></li><li><a href="#g:2">Construction</a></li><li><a href="#g:3">Safety</a></li><li><a href="#g:4">Code that must be here for accessibility</a></li><li><a href="#g:5">Utilities</a></li><li><a href="#g:6">Checked multiplication</a></li><li><a href="#g:7">Debugging</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A module containing private <code><a href="Data-Text-Internal.html#t:Text">Text</a></code> internals. This exposes the
 <code><a href="Data-Text-Internal.html#t:Text">Text</a></code> representation and low level construction functions.
 Modules which extend the <code><a href="Data-Text-Internal.html#t:Text">Text</a></code> system may need to use this module.</p><p>You should not use this module unless you are determined to monkey
 with the internals, as the functions here do just about nothing to
 preserve data invariants.  You have been warned!</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:Text">Text</a> = <a href="#v:Text">Text</a> !<a href="Data-Text-Array.html#t:Array">Array</a> !<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> !<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:text">text</a> :: <a href="Data-Text-Array.html#t:Array">Array</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="Data-Text-Internal.html#t:Text">Text</a></li><li class="src short"><a href="#v:textP">textP</a> :: <a href="Data-Text-Array.html#t:Array">Array</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="Data-Text-Internal.html#t:Text">Text</a></li><li class="src short"><a href="#v:safe">safe</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:empty">empty</a> :: <a href="Data-Text-Internal.html#t:Text">Text</a></li><li class="src short"><a href="#v:empty_">empty_</a> :: <a href="Data-Text-Internal.html#t:Text">Text</a></li><li class="src short"><a href="#v:firstf">firstf</a> :: (a -&gt; c) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (a, b) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (c, b)</li><li class="src short"><a href="#v:mul">mul</a> :: <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="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:mul32">mul32</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int32">Int32</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int32">Int32</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int32">Int32</a></li><li class="src short"><a href="#v:mul64">mul64</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a></li><li class="src short"><a href="#v:showText">showText</a> :: <a href="Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li></ul></div><div id="interface"><h1 id="g:1">Types</h1><div class="doc"><p>Internally, the <code><a href="Data-Text-Internal.html#t:Text">Text</a></code> type is represented as an array of <code>Word16</code>
 UTF-16 code units. The offset and length fields in the constructor
 are in these units, <em>not</em> units of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></code>.</p><p>Invariants that all functions must maintain:</p><ul><li>Since the <code><a href="Data-Text-Internal.html#t:Text">Text</a></code> type uses UTF-16 internally, it cannot represent
   characters in the reserved surrogate code point range U+D800 to
   U+DFFF. To maintain this invariant, the <code><a href="Data-Text-Internal.html#v:safe">safe</a></code> function maps
   <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></code> values in this range to the replacement character (U+FFFD,
   '&#65533;').</li><li>A leading (or &quot;high&quot;) surrogate code unit (0xD800&#8211;0xDBFF) must
   always be followed by a trailing (or &quot;low&quot;) surrogate code unit
   (0xDC00-0xDFFF). A trailing surrogate code unit must always be
   preceded by a leading surrogate code unit.</li></ul></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Text" class="def">Text</a> <a href="src/Data-Text-Internal.html#Text" class="link">Source</a> <a href="#t:Text" class="selflink">#</a></p><div class="doc"><p>A space efficient, packed, unboxed Unicode text type.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Text" class="def">Text</a> !<a href="Data-Text-Array.html#t:Array">Array</a> !<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> !<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 empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:Text" class="caption collapser" onclick="toggleSection('i:Text')">Instances</p><div id="section.i:Text" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Text:Item:1" class="instance expander" onclick="toggleSection('i:id:Text:Item:1')"></span> <span class="keyword">type</span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Exts.html#t:Item">Item</a> <a href="Data-Text-Internal.html#t:Text">Text</a></span> <a href="#t:Item" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Text:Item:1" class="inst-details hide"><div class="src"><span class="keyword">type</span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Exts.html#t:Item">Item</a> <a href="Data-Text-Internal.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></div></div></td></tr></table></div></div></div><h1 id="g:2">Construction</h1><div class="top"><p class="src"><a id="v:text" class="def">text</a> :: <a href="Data-Text-Array.html#t:Array">Array</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="Data-Text-Internal.html#t:Text">Text</a> <a href="src/Data-Text-Internal.html#text" class="link">Source</a> <a href="#v:text" class="selflink">#</a></p><div class="doc"><p>Construct a <code><a href="Data-Text-Internal.html#t:Text">Text</a></code> without invisibly pinning its byte array in
 memory if its length has dwindled to zero.</p></div></div><div class="top"><p class="src"><a id="v:textP" class="def">textP</a> :: <a href="Data-Text-Array.html#t:Array">Array</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="Data-Text-Internal.html#t:Text">Text</a> <a href="src/Data-Text-Internal.html#textP" class="link">Source</a> <a href="#v:textP" class="selflink">#</a></p><div class="doc"><div class="warning"><p>Deprecated: Use text instead</p></div></div></div><h1 id="g:3">Safety</h1><div class="top"><p class="src"><a id="v:safe" class="def">safe</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a> -&gt; <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/Data-Text-Internal.html#safe" class="link">Source</a> <a href="#v:safe" class="selflink">#</a></p><div class="doc"><p>Map a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></code> to a <code><a href="Data-Text-Internal.html#t:Text">Text</a></code>-safe value.</p><p>UTF-16 surrogate code points are not included in the set of Unicode
 scalar values, but are unfortunately admitted as valid <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></code>
 values by Haskell.  They cannot be represented in a <code><a href="Data-Text-Internal.html#t:Text">Text</a></code>.  This
 function remaps those code points to the Unicode replacement
 character (U+FFFD, '&#65533;'), and leaves other code points
 unchanged.</p></div></div><h1 id="g:4">Code that must be here for accessibility</h1><div class="top"><p class="src"><a id="v:empty" class="def">empty</a> :: <a href="Data-Text-Internal.html#t:Text">Text</a> <a href="src/Data-Text-Internal.html#empty" class="link">Source</a> <a href="#v:empty" class="selflink">#</a></p><div class="doc"><p><em>O(1)</em> The empty <code><a href="Data-Text-Internal.html#t:Text">Text</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:empty_" class="def">empty_</a> :: <a href="Data-Text-Internal.html#t:Text">Text</a> <a href="src/Data-Text-Internal.html#empty_" class="link">Source</a> <a href="#v:empty_" class="selflink">#</a></p><div class="doc"><p>A non-inlined version of <code><a href="Data-Text-Internal.html#v:empty">empty</a></code>.</p></div></div><h1 id="g:5">Utilities</h1><div class="top"><p class="src"><a id="v:firstf" class="def">firstf</a> :: (a -&gt; c) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (a, b) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (c, b) <a href="src/Data-Text-Internal.html#firstf" class="link">Source</a> <a href="#v:firstf" class="selflink">#</a></p><div class="doc"><p>Apply a function to the first element of an optional pair.</p></div></div><h1 id="g:6">Checked multiplication</h1><div class="top"><p class="src"><a id="v:mul" class="def">mul</a> :: <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="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <span class="fixity">infixl 7</span><span class="rightedge"></span> <a href="src/Data-Text-Internal.html#mul" class="link">Source</a> <a href="#v:mul" class="selflink">#</a></p><div class="doc"><p>Checked multiplication.  Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#v:error">error</a></code> if the result would
 overflow.</p></div></div><div class="top"><p class="src"><a id="v:mul32" class="def">mul32</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int32">Int32</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int32">Int32</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int32">Int32</a> <span class="fixity">infixl 7</span><span class="rightedge"></span> <a href="src/Data-Text-Internal.html#mul32" class="link">Source</a> <a href="#v:mul32" class="selflink">#</a></p><div class="doc"><p>Checked multiplication.  Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#v:error">error</a></code> if the result would
 overflow.</p></div></div><div class="top"><p class="src"><a id="v:mul64" class="def">mul64</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a> <span class="fixity">infixl 7</span><span class="rightedge"></span> <a href="src/Data-Text-Internal.html#mul64" class="link">Source</a> <a href="#v:mul64" class="selflink">#</a></p><div class="doc"><p>Checked multiplication.  Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#v:error">error</a></code> if the result would
 overflow.</p></div></div><h1 id="g:7">Debugging</h1><div class="top"><p class="src"><a id="v:showText" class="def">showText</a> :: <a href="Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="src/Data-Text-Internal.html#showText" class="link">Source</a> <a href="#v:showText" class="selflink">#</a></p><div class="doc"><p>A useful <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#v:show">show</a></code>-like function for debugging purposes.</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>