This file is indexed.

/usr/share/doc/libghc-random-source-doc/html/Data-Random-Source-PureMT.html is in libghc-random-source-doc 0.3.0.6-3build1.

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.Random.Source.PureMT</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-Random-Source-PureMT.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Random-Source-PureMT.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">random-source-0.3.0.6: Generic basis for random number generators</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Data.Random.Source.PureMT</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module provides functions useful for implementing new <code><a href="Data-Random-Internal-Source.html#t:MonadRandom">MonadRandom</a></code>
 and <code><a href="Data-Random-Internal-Source.html#t:RandomSource">RandomSource</a></code> instances for state-abstractions containing <code><a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></code>
 values (the pure pseudorandom generator provided by the
 mersenne-random-pure64 package), as well as instances for some common
 cases.</p><p>A <code><a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></code> generator is immutable, so <code><a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></code> by itself cannot be a 
 <code><a href="Data-Random-Internal-Source.html#t:RandomSource">RandomSource</a></code> (if it were, it would always give the same &quot;random&quot;
 values).  Some form of mutable state must be used, such as an <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a></code>,
 <code><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Lazy.html#t:State">State</a></code> monad, etc..  A few default instances are provided by this module
 along with a more-general function (<code><a href="Data-Random-Source-PureMT.html#v:getRandomPrimFromMTRef">getRandomPrimFromMTRef</a></code>) usable as
 an implementation for new cases users might need.</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:PureMT">PureMT</a> :: *</li><li class="src short"><a href="#v:newPureMT">newPureMT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></li><li class="src short"><a href="#v:pureMT">pureMT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Word.html#t:Word64">Word64</a> -&gt; <a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></li><li class="src short"><a href="#v:getRandomPrimFromMTRef">getRandomPrimFromMTRef</a> :: <a href="file:///usr/share/doc/libghc-stateref-doc/html/Data-StateRef-Types.html#t:ModifyRef">ModifyRef</a> sr m <a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a> =&gt; sr -&gt; <a href="Data-Random-Internal-Source.html#t:Prim">Prim</a> a -&gt; m a</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:PureMT" class="def">PureMT</a> :: *</p><div class="doc"><p><code><a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></code>, a pure mersenne twister pseudo-random number generator</p></div><div class="subs instances"><p id="control.i:PureMT" class="caption collapser" onclick="toggleSection('i:PureMT')">Instances</p><div id="section.i:PureMT" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Show.html#t:Show">Show</a> <a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/libghc-random-doc/html/System-Random.html#t:RandomGen">RandomGen</a> <a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></span></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:newPureMT" class="def">newPureMT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> <a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></p><div class="doc"><p>Create a new PureMT generator, using the clocktime as the base for the seed.</p></div></div><div class="top"><p class="src"><a name="v:pureMT" class="def">pureMT</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Word.html#t:Word64">Word64</a> -&gt; <a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></p><div class="doc"><p>Create a PureMT generator from a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Word.html#t:Word64">Word64</a></code> seed.</p></div></div><div class="top"><p class="src"><a name="v:getRandomPrimFromMTRef" class="def">getRandomPrimFromMTRef</a> :: <a href="file:///usr/share/doc/libghc-stateref-doc/html/Data-StateRef-Types.html#t:ModifyRef">ModifyRef</a> sr m <a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a> =&gt; sr -&gt; <a href="Data-Random-Internal-Source.html#t:Prim">Prim</a> a -&gt; m a <a href="src/Data-Random-Source-PureMT.html#getRandomPrimFromMTRef" class="link">Source</a></p><div class="doc"><p>Given a mutable reference to a <code><a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></code> generator, we can implement
 <code><a href="Data-Random-Internal-Source.html#t:RandomSource">RandomSource</a></code> for it in any monad in which the reference can be modified.</p><p>Typically this would be used to define a new <code><a href="Data-Random-Internal-Source.html#t:RandomSource">RandomSource</a></code> instance for
 some new reference type or new monad in which an existing reference type
 can be modified atomically.  As an example, the following instance could
 be used to describe how <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-IORef.html#t:IORef">IORef</a></code> <code><a href="Data-Random-Source-PureMT.html#t:PureMT">PureMT</a></code> can be a <code><a href="Data-Random-Internal-Source.html#t:RandomSource">RandomSource</a></code> in the
 <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a></code> monad:</p><pre>instance RandomSource IO (IORef PureMT) where
    supportedPrimsFrom _ _ = True
    getSupportedRandomPrimFrom = getRandomPrimFromMTRef</pre><p>(note that there is actually a more general instance declared already
 covering this as a a special case, so there's no need to repeat this
 declaration anywhere)</p><p>Example usage (using some functions from <a href="Data-Random.html">Data.Random</a> in the random-fu 
 package):</p><pre>main = do
    src &lt;- newIORef (pureMT 1234)          -- OR: newPureMT &gt;&gt;= newIORef
    x &lt;- runRVar (uniform 0 100) src :: IO Double
    print x</pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>