This file is indexed.

/usr/share/doc/libghc-hspec-core-doc/html/Test-Hspec-Core-Util.html is in libghc-hspec-core-doc 2.2.4-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
<!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>Test.Hspec.Core.Util</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_Test-Hspec-Core-Util.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Test-Hspec-Core-Util.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">hspec-core-2.2.4: A Testing Framework for Haskell</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Stability</th><td>unstable</td></tr><tr><th>Safe Haskell</th><td>Safe</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Test.Hspec.Core.Util</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">String functions</a></li><li><a href="#g:2">Working with paths</a></li><li><a href="#g:3">Working with exception</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc empty">&nbsp;</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:pluralize">pluralize</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/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><li class="src short"><a href="#v:strip">strip</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><li class="src short"><a href="#v:lineBreaksAt">lineBreaksAt</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/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><li class="src short"><span class="keyword">type</span> <a href="#t:Path">Path</a> = ([<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>], <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>)</li><li class="src short"><a href="#v:formatRequirement">formatRequirement</a> :: <a href="Test-Hspec-Core-Util.html#t:Path">Path</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><li class="src short"><a href="#v:filterPredicate">filterPredicate</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="Test-Hspec-Core-Util.html#t:Path">Path</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:safeTry">safeTry</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:SomeException">SomeException</a> a)</li><li class="src short"><a href="#v:formatException">formatException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:SomeException">SomeException</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">String functions</h1><div class="top"><p class="src"><a id="v:pluralize" class="def">pluralize</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/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/Test-Hspec-Core-Util.html#pluralize" class="link">Source</a> <a href="#v:pluralize" class="selflink">#</a></p><div class="doc"><p><code>pluralize count singular</code> pluralizes the given <code>singular</code> word unless given
 <code>count</code> is 1.</p><p>Examples:</p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>pluralize 0 &quot;example&quot;
</code></strong>&quot;0 examples&quot;
</pre><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>pluralize 1 &quot;example&quot;
</code></strong>&quot;1 example&quot;
</pre><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>pluralize 2 &quot;example&quot;
</code></strong>&quot;2 examples&quot;
</pre></div></div><div class="top"><p class="src"><a id="v:strip" class="def">strip</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/Test-Hspec-Core-Util.html#strip" class="link">Source</a> <a href="#v:strip" class="selflink">#</a></p><div class="doc"><p>Strip leading and trailing whitespace</p></div></div><div class="top"><p class="src"><a id="v:lineBreaksAt" class="def">lineBreaksAt</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/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/Test-Hspec-Core-Util.html#lineBreaksAt" class="link">Source</a> <a href="#v:lineBreaksAt" class="selflink">#</a></p><div class="doc"><p>ensure that lines are not longer then given <code>n</code>, insert line breaks at word
 boundaries</p></div></div><h1 id="g:2">Working with paths</h1><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:Path" class="def">Path</a> = ([<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>], <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/Test-Hspec-Core-Util.html#Path" class="link">Source</a> <a href="#t:Path" class="selflink">#</a></p><div class="doc"><p>A <code><a href="Test-Hspec-Core-Util.html#t:Path">Path</a></code> represents the location of an example within the spec tree.</p><p>It consists of a list of group descriptions and a requirement description.</p></div></div><div class="top"><p class="src"><a id="v:formatRequirement" class="def">formatRequirement</a> :: <a href="Test-Hspec-Core-Util.html#t:Path">Path</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/Test-Hspec-Core-Util.html#formatRequirement" class="link">Source</a> <a href="#v:formatRequirement" class="selflink">#</a></p><div class="doc"><p>Try to create a proper English sentence from a path by applying some
 heuristics.</p></div></div><div class="top"><p class="src"><a id="v:filterPredicate" class="def">filterPredicate</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="Test-Hspec-Core-Util.html#t:Path">Path</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="src/Test-Hspec-Core-Util.html#filterPredicate" class="link">Source</a> <a href="#v:filterPredicate" class="selflink">#</a></p><div class="doc"><p>A predicate that can be used to filter a spec tree.</p></div></div><h1 id="g:3">Working with exception</h1><div class="top"><p class="src"><a id="v:safeTry" class="def">safeTry</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:SomeException">SomeException</a> a) <a href="src/Test-Hspec-Core-Util.html#safeTry" class="link">Source</a> <a href="#v:safeTry" class="selflink">#</a></p><div class="doc"><p><code>safeTry</code> evaluates given action and returns its result.  If an exception
 occurs, the exception is returned instead.  Unlike <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#v:try">try</a></code> it is agnostic to
 asynchronous exceptions.</p></div></div><div class="top"><p class="src"><a id="v:formatException" class="def">formatException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:SomeException">SomeException</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/Test-Hspec-Core-Util.html#formatException" class="link">Source</a> <a href="#v:formatException" class="selflink">#</a></p><div class="doc"><p>The function <code><a href="Test-Hspec-Core-Util.html#v:formatException">formatException</a></code> converts an exception to a string.</p><p>This is different from <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#v:show">show</a></code>.  The type of the exception is included, e.g.:</p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>formatException (toException DivideByZero)
</code></strong>&quot;ArithException (divide by zero)&quot;
</pre><p>For <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:IOException">IOException</a></code>s the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#t:IOErrorType">IOErrorType</a></code> is included, as well.</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>