This file is indexed.

/usr/share/doc/libghc-hxt-doc/html/Data-Atom.html is in libghc-hxt-doc 9.3.1.16-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Data.Atom</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-Atom.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Atom.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">hxt-9.3.1.16: A collection of tools for processing XML with Haskell.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>Copyright (C) 2008 Uwe Schmidt</td></tr><tr><th>License</th><td>MIT</td></tr><tr><th>Maintainer</th><td>Uwe Schmidt (uwe\@fh-wedel.de)</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>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Data.Atom</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Atom objects</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Unique Atoms generated from Strings and
   managed as flyweights</p><p>Data.Atom can be used for caching and storage optimisation
   of frequently used strings. An <code>Atom</code> is constructed from a <code>String</code>.
   For two equal strings the identical atom is returned.</p><p>This module can be used for optimizing memory usage when working with
   strings or names. Many applications use data types like
   <code>Map String SomeAttribute</code> where a rather fixed set of keys is used.
   Especially XML applications often work with a limited set of element and attribute names.
   For these applications it becomes more memory efficient when working with types like
   <code>Map Atom SomeAttribute</code> and convert the keys into atoms before operating
   on such a map.</p><p>Internally this module manages a map of atoms. The atoms are internally represented
   by <code>ByteString</code>s. When creating a new atom from a string, the string is first converted
   into an UTF8 <code>Word8</code> sequence, which is packed into a <code>ByteString</code>. This <code>ByteString</code> is looked
   up in the table of atoms. If it is already there, the value in the map is used as atom, else
   the new <code>ByteString</code> is inserted into the map.</p><p>Of course the implementation of this name cache uses <code>unsavePerformIO</code>.
   The global cache is managed by ue of an <code>IORef</code> and atomicModifyIORef.</p><p>The following laws hold for atoms</p><pre>
s  ==       t =&gt; newAtom s  ==       newAtom t
s `compare` t =&gt; newAtom s `compare` newAtom t
show . newAtom == id</pre><p>Equality test for <code>Atom</code>s runs in <em>O(1)</em>, it is just a pointer comarison.
   The <code>Ord</code> comparisons have the same runtime like the <code>ByteString</code> comparisons.
   Internally there is an UTF8 comparison, but UTF8 encoding preserves the total order.</p><p>Warning: The internal cache never shrinks during execution. So using it in a
   undisciplined way can lead to memory leaks.</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:Atom">Atom</a></li><li class="src short"><a href="#v:newAtom">newAtom</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a></li><li class="src short"><a href="#v:share">share</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li></ul></div><div id="interface"><h1 id="g:1">Atom objects</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Atom" class="def">Atom</a> <a href="src/Data-Atom.html#Atom" class="link">Source</a> <a href="#t:Atom" class="selflink">#</a></p><div class="subs instances"><p id="control.i:Atom" class="caption collapser" onclick="toggleSection('i:Atom')">Instances</p><div id="section.i:Atom" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Atom:Eq:1" class="instance expander" onclick="toggleSection('i:id:Atom:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> <a href="Data-Atom.html#t:Atom">Atom</a></span> <a href="src/Data-Atom.html#line-122" class="link">Source</a> <a href="#t:Atom" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Atom:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Atom:Ord:2" class="instance expander" onclick="toggleSection('i:id:Atom:Ord:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ord">Ord</a> <a href="Data-Atom.html#t:Atom">Atom</a></span> <a href="src/Data-Atom.html#line-128" class="link">Source</a> <a href="#t:Atom" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Atom:Ord:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(&lt;)</a> :: <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(&lt;=)</a> :: <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(&gt;)</a> :: <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(&gt;=)</a> :: <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> <a href="#v:min" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Atom:Read:3" class="instance expander" onclick="toggleSection('i:id:Atom:Read:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#t:Read">Read</a> <a href="Data-Atom.html#t:Atom">Atom</a></span> <a href="src/Data-Atom.html#line-133" class="link">Source</a> <a href="#t:Atom" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Atom:Read:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:readsPrec">readsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> <a href="Data-Atom.html#t:Atom">Atom</a> <a href="#v:readsPrec" class="selflink">#</a></p><p class="src"><a href="#v:readList">readList</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> [<a href="Data-Atom.html#t:Atom">Atom</a>] <a href="#v:readList" class="selflink">#</a></p><p class="src"><a href="#v:readPrec">readPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> <a href="Data-Atom.html#t:Atom">Atom</a> <a href="#v:readPrec" class="selflink">#</a></p><p class="src"><a href="#v:readListPrec">readListPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> [<a href="Data-Atom.html#t:Atom">Atom</a>] <a href="#v:readListPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Atom:Show:4" class="instance expander" onclick="toggleSection('i:id:Atom:Show:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> <a href="Data-Atom.html#t:Atom">Atom</a></span> <a href="src/Data-Atom.html#line-136" class="link">Source</a> <a href="#t:Atom" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Atom:Show:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Data-Atom.html#t:Atom">Atom</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Atom:NFData:5" class="instance expander" onclick="toggleSection('i:id:Atom:NFData:5')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> <a href="Data-Atom.html#t:Atom">Atom</a></span> <a href="src/Data-Atom.html#line-140" class="link">Source</a> <a href="#t:Atom" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Atom:NFData:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:rnf">rnf</a> :: <a href="Data-Atom.html#t:Atom">Atom</a> -&gt; () <a href="#v:rnf" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:newAtom" class="def">newAtom</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Data-Atom.html#t:Atom">Atom</a> <a href="src/Data-Atom.html#newAtom" class="link">Source</a> <a href="#v:newAtom" class="selflink">#</a></p><div class="doc"><p>creation of an <code>Atom</code> from a <code>String</code></p></div></div><div class="top"><p class="src"><a id="v:share" class="def">share</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="src/Data-Atom.html#share" class="link">Source</a> <a href="#v:share" class="selflink">#</a></p><div class="doc"><p>Insert a <code>String</code> into the atom cache and convert the atom back into a <code>String</code>.</p><p>locically <code>share == id</code> holds, but internally equal strings share the same memory.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>