This file is indexed.

/usr/share/doc/libghc-lrucache-doc/html/Data-Cache-LRU-Internal.html is in libghc-lrucache-doc 1.1.1.3-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
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
<!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.Cache.LRU.Internal</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-Cache-LRU-Internal.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Cache-LRU-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">lrucache-1.1.1.3: a simple, pure LRU cache</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Safe-Inferred</td></tr></table><p class="caption">Data.Cache.LRU.Internal</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module provides access to all the internals use by the LRU
 type.  This can be used to create data structures that violate the
 invariants the public interface maintains.  Be careful when using
 this module.  The <code><a href="Data-Cache-LRU-Internal.html#v:valid">valid</a></code> function can be used to check if an LRU
 structure satisfies the invariants the public interface maintains.
</p><p>If this degree of control isn't needed, consider using
 <a href="Data-Cache-LRU.html">Data.Cache.LRU</a> instead.
</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:LRU">LRU</a> key val = <a href="#v:LRU">LRU</a> {<ul class="subs"><li><a href="#v:first">first</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> key)</li><li><a href="#v:last">last</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> key)</li><li><a href="#v:maxSize">maxSize</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a>)</li><li><a href="#v:content">content</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> key (<a href="Data-Cache-LRU-Internal.html#t:LinkedVal">LinkedVal</a> key val))</li></ul>}</li><li class="src short"><span class="keyword">data</span>  <a href="#t:LinkedVal">LinkedVal</a> key val = <a href="#v:Link">Link</a> {<ul class="subs"><li><a href="#v:value">value</a> :: val</li><li><a href="#v:prev">prev</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> key)</li><li><a href="#v:next">next</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> key)</li></ul>}</li><li class="src short"><a href="#v:newLRU">newLRU</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a> -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val</li><li class="src short"><a href="#v:fromList">fromList</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a> -&gt; [(key, val)] -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val</li><li class="src short"><a href="#v:toList">toList</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; [(key, val)]</li><li class="src short"><a href="#v:insert">insert</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; key -&gt; val -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val</li><li class="src short"><a href="#v:lookup">lookup</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; key -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; (<a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> val)</li><li class="src short"><a href="#v:delete">delete</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; key -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; (<a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> val)</li><li class="src short"><a href="#v:pop">pop</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; (<a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> (key, val))</li><li class="src short"><a href="#v:size">size</a> ::  <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:hit-39-">hit'</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; key -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val</li><li class="src short"><a href="#v:delete-39-">delete'</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; key -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> key (<a href="Data-Cache-LRU-Internal.html#t:LinkedVal">LinkedVal</a> key val) -&gt; <a href="Data-Cache-LRU-Internal.html#t:LinkedVal">LinkedVal</a> key val -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val</li><li class="src short"><a href="#v:adjust-39-">adjust'</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> k =&gt; (a -&gt; a) -&gt; k -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> k a -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> k a</li><li class="src short"><a href="#v:valid">valid</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:LRU" class="def">LRU</a> key val <a href="src/Data-Cache-LRU-Internal.html#LRU" class="link">Source</a></p><div class="doc"><p>Stores the information that makes up an LRU cache
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:LRU" class="def">LRU</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:first" class="def">first</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> key)</dt><dd class="doc"><p>the key of the most recently accessed entry
</p></dd><dt class="src"><a name="v:last" class="def">last</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> key)</dt><dd class="doc"><p>the key of the least recently accessed entry
</p></dd><dt class="src"><a name="v:maxSize" class="def">maxSize</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a>)</dt><dd class="doc"><p>the maximum size of the LRU cache
</p></dd><dt class="src"><a name="v:content" class="def">content</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> key (<a href="Data-Cache-LRU-Internal.html#t:LinkedVal">LinkedVal</a> key val))</dt><dd class="doc"><p>the backing <code><a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a></code>
</p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:LRU" class="caption collapser" onclick="toggleSection('i:LRU')">Instances</p><div id="section.i:LRU" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> (<a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> key, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> val) =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> (<a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> key, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> val) =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> (<a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:LinkedVal" class="def">LinkedVal</a> key val <a href="src/Data-Cache-LRU-Internal.html#LinkedVal" class="link">Source</a></p><div class="doc"><p>The values stored in the Map of the LRU cache.  They embed a
 doubly-linked list through the values of the <code><a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a></code>.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Link" class="def">Link</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:value" class="def">value</a> :: val</dt><dd class="doc"><p>The actual value
</p></dd><dt class="src"><a name="v:prev" class="def">prev</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> key)</dt><dd class="doc"><p>the key of the value before this one
</p></dd><dt class="src"><a name="v:next" class="def">next</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> key)</dt><dd class="doc"><p>the key of the value after this one
</p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:LinkedVal" class="caption collapser" onclick="toggleSection('i:LinkedVal')">Instances</p><div id="section.i:LinkedVal" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> (<a href="Data-Cache-LRU-Internal.html#t:LinkedVal">LinkedVal</a> key)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> key, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> val) =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> (<a href="Data-Cache-LRU-Internal.html#t:LinkedVal">LinkedVal</a> key val)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:newLRU" class="def">newLRU</a><a href="src/Data-Cache-LRU-Internal.html#newLRU" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a></td><td class="doc"><p>the optional maximum size of the LRU
</p></td></tr><tr><td class="src">-&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Make an LRU.  If a size limit is specified, the LRU is guaranteed
 to not grow above the specified number of entries.
</p></div></div><div class="top"><p class="src"><a name="v:fromList" class="def">fromList</a><a href="src/Data-Cache-LRU-Internal.html#fromList" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a></td><td class="doc"><p>the optional maximum size of the LRU
</p></td></tr><tr><td class="src">-&gt; [(key, val)]</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Build a new LRU from the given maximum size and list of contents,
 in order from most recently accessed to least recently accessed.
</p></div></div><div class="top"><p class="src"><a name="v:toList" class="def">toList</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; [(key, val)]<a href="src/Data-Cache-LRU-Internal.html#toList" class="link">Source</a></p><div class="doc"><p>Retrieve a list view of an LRU.  The items are returned in
 order from most recently accessed to least recently accessed.
</p></div></div><div class="top"><p class="src"><a name="v:insert" class="def">insert</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; key -&gt; val -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val<a href="src/Data-Cache-LRU-Internal.html#insert" class="link">Source</a></p><div class="doc"><p>Add an item to an LRU.  If the key was already present in the
 LRU, the value is changed to the new value passed in.  The
 item added is marked as the most recently accessed item in the
 LRU returned.
</p><p>If this would cause the LRU to exceed its maximum size, the
 least recently used item is dropped from the cache.
</p></div></div><div class="top"><p class="src"><a name="v:lookup" class="def">lookup</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; key -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; (<a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> val)<a href="src/Data-Cache-LRU-Internal.html#lookup" class="link">Source</a></p><div class="doc"><p>Look up an item in an LRU.  If it was present, it is marked as
 the most recently accesed in the returned LRU.
</p></div></div><div class="top"><p class="src"><a name="v:delete" class="def">delete</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; key -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; (<a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> val)<a href="src/Data-Cache-LRU-Internal.html#delete" class="link">Source</a></p><div class="doc"><p>Remove an item from an LRU.  Returns the new LRU, and the value
 removed if the key was present.
</p></div></div><div class="top"><p class="src"><a name="v:pop" class="def">pop</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; (<a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> (key, val))<a href="src/Data-Cache-LRU-Internal.html#pop" class="link">Source</a></p><div class="doc"><p>Removes the least-recently accessed element from the LRU.
 Returns the new LRU, and the key and value from the least-recently
 used element, if there was one.
</p></div></div><div class="top"><p class="src"><a name="v:size" class="def">size</a> ::  <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a><a href="src/Data-Cache-LRU-Internal.html#size" class="link">Source</a></p><div class="doc"><p>Returns the number of elements the LRU currently contains.
</p></div></div><div class="top"><p class="src"><a name="v:hit-39-" class="def">hit'</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; key -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val<a href="src/Data-Cache-LRU-Internal.html#hit%27" class="link">Source</a></p><div class="doc"><p>Internal function.  The key passed in must be present in the
 LRU.  Moves the item associated with that key to the most
 recently accessed position.
</p></div></div><div class="top"><p class="src"><a name="v:delete-39-" class="def">delete'</a><a href="src/Data-Cache-LRU-Internal.html#delete%27" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; key</td><td class="doc"><p>The key must be present in the provided <code><a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a></code>
</p></td></tr><tr><td class="src">-&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val</td><td class="doc"><p>This is the <code><a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a></code> to modify
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> key (<a href="Data-Cache-LRU-Internal.html#t:LinkedVal">LinkedVal</a> key val)</td><td class="doc"><p>this is the <code><a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a></code> from the
 previous argument, but with
 the key already removed from
 it.  This isn't consistent
 yet, as it still might
 contain LinkedVals with
 pointers to the removed key.
</p></td></tr><tr><td class="src">-&gt; <a href="Data-Cache-LRU-Internal.html#t:LinkedVal">LinkedVal</a> key val</td><td class="doc"><p>This is the <code><a href="Data-Cache-LRU-Internal.html#t:LinkedVal">LinkedVal</a></code> that
 corresponds to the key in the passed
 in LRU. It is absent from the passed
 in map.
</p></td></tr><tr><td class="src">-&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>An internal function used by <code><a href="Data-Cache-LRU-Internal.html#v:insert">insert</a></code> (when the cache is full)
 and <code><a href="Data-Cache-LRU-Internal.html#v:delete">delete</a></code>.  This function has strict requirements on its
 arguments in order to work properly.
</p><p>As this is intended to be an internal function, the arguments were
 chosen to avoid repeated computation, rather than for simplicity of
 calling this function.
</p></div></div><div class="top"><p class="src"><a name="v:adjust-39-" class="def">adjust'</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> k =&gt; (a -&gt; a) -&gt; k -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> k a -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> k a<a href="src/Data-Cache-LRU-Internal.html#adjust%27" class="link">Source</a></p><div class="doc"><p>Internal function.  This is very similar to <code><a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#v:adjust">adjust</a></code>, with
 two major differences.  First, it's strict in the application of
 the function, which is a huge win when working with this structure.
</p><p>Second, it requires that the key be present in order to work.  If
 the key isn't present, <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#v:undefined">undefined</a></code> will be inserted into the <code><a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a></code>,
 which will cause problems later.
</p></div></div><div class="top"><p class="src"><a name="v:valid" class="def">valid</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> key =&gt; <a href="Data-Cache-LRU-Internal.html#t:LRU">LRU</a> key val -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Data-Cache-LRU-Internal.html#valid" class="link">Source</a></p><div class="doc"><p>Internal function.  This checks the four structural invariants
 of the LRU cache structure:
</p><ol><li> The cache's size does not exceed the specified max size.
</li><li> The linked list through the nodes is consistent in both directions.
</li><li> The linked list contains the same number of nodes as the cache.
</li><li> Every key in the linked list is in the <code><a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a></code>.
</li></ol></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>