This file is indexed.

/usr/share/doc/libghc-hledger-lib-doc/html/Hledger-Utils-Text.html is in libghc-hledger-lib-doc 1.2-1build3.

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
<!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>Hledger.Utils.Text</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_Hledger-Utils-Text.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Hledger-Utils-Text.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">hledger-lib-1.2: Core data types, parsers and functionality for the hledger accounting tools</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>Haskell2010</td></tr></table><p class="caption">Hledger.Utils.Text</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Text formatting helpers, ported from String as needed.
 There may be better alternatives out there.</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"><a href="#v:textstrip">textstrip</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:textlstrip">textlstrip</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:textrstrip">textrstrip</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:textElideRight">textElideRight</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/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:quoteIfSpaced">quoteIfSpaced</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:quotechars">quotechars</a> :: [<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:whitespacechars">whitespacechars</a> :: [<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:escapeDoubleQuotes">escapeDoubleQuotes</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:escapeSingleQuotes">escapeSingleQuotes</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:stripquotes">stripquotes</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:isSingleQuoted">isSingleQuoted</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isDoubleQuoted">isDoubleQuoted</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:textUnbracket">textUnbracket</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:textConcatTopPadded">textConcatTopPadded</a> :: [<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a>] -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:difforzero">difforzero</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Num">Num</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a) =&gt; a -&gt; a -&gt; a</li><li class="src short"><a href="#v:fitText">fitText</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</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-Maybe.html#t:Maybe">Maybe</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-Bool.html#t:Bool">Bool</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:textPadLeftWide">textPadLeftWide</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/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:textPadRightWide">textPadRightWide</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/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:textTakeWidth">textTakeWidth</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/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><a href="#v:textWidth">textWidth</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</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></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a id="v:textstrip" class="def">textstrip</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#textstrip" class="link">Source</a> <a href="#v:textstrip" class="selflink">#</a></p><div class="doc"><p>Remove leading and trailing whitespace.</p></div></div><div class="top"><p class="src"><a id="v:textlstrip" class="def">textlstrip</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#textlstrip" class="link">Source</a> <a href="#v:textlstrip" class="selflink">#</a></p><div class="doc"><p>Remove leading whitespace.</p></div></div><div class="top"><p class="src"><a id="v:textrstrip" class="def">textrstrip</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#textrstrip" class="link">Source</a> <a href="#v:textrstrip" class="selflink">#</a></p><div class="doc"><p>Remove trailing whitespace.</p></div></div><div class="top"><p class="src"><a id="v:textElideRight" class="def">textElideRight</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/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#textElideRight" class="link">Source</a> <a href="#v:textElideRight" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:quoteIfSpaced" class="def">quoteIfSpaced</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#quoteIfSpaced" class="link">Source</a> <a href="#v:quoteIfSpaced" class="selflink">#</a></p><div class="doc"><p>Wrap a string in double quotes, and -prefix any embedded single
 quotes, if it contains whitespace and is not already single- or
 double-quoted.</p></div></div><div class="top"><p class="src"><a id="v:quotechars" class="def">quotechars</a> :: [<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/Hledger-Utils-Text.html#quotechars" class="link">Source</a> <a href="#v:quotechars" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:whitespacechars" class="def">whitespacechars</a> :: [<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/Hledger-Utils-Text.html#whitespacechars" class="link">Source</a> <a href="#v:whitespacechars" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:escapeDoubleQuotes" class="def">escapeDoubleQuotes</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#escapeDoubleQuotes" class="link">Source</a> <a href="#v:escapeDoubleQuotes" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:escapeSingleQuotes" class="def">escapeSingleQuotes</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#escapeSingleQuotes" class="link">Source</a> <a href="#v:escapeSingleQuotes" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:stripquotes" class="def">stripquotes</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#stripquotes" class="link">Source</a> <a href="#v:stripquotes" class="selflink">#</a></p><div class="doc"><p>Strip one matching pair of single or double quotes on the ends of a string.</p></div></div><div class="top"><p class="src"><a id="v:isSingleQuoted" class="def">isSingleQuoted</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Utils-Text.html#isSingleQuoted" class="link">Source</a> <a href="#v:isSingleQuoted" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:isDoubleQuoted" class="def">isDoubleQuoted</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Utils-Text.html#isDoubleQuoted" class="link">Source</a> <a href="#v:isDoubleQuoted" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:textUnbracket" class="def">textUnbracket</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#textUnbracket" class="link">Source</a> <a href="#v:textUnbracket" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:textConcatTopPadded" class="def">textConcatTopPadded</a> :: [<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a>] -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#textConcatTopPadded" class="link">Source</a> <a href="#v:textConcatTopPadded" class="selflink">#</a></p><div class="doc"><p>Join several multi-line strings as side-by-side rectangular strings of the same height, top-padded.
 Treats wide characters as double width.</p></div></div><div class="top"><p class="src"><a id="v:difforzero" class="def">difforzero</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Num">Num</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a) =&gt; a -&gt; a -&gt; a <a href="src/Hledger-Utils-Text.html#difforzero" class="link">Source</a> <a href="#v:difforzero" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:fitText" class="def">fitText</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</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-Maybe.html#t:Maybe">Maybe</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-Bool.html#t:Bool">Bool</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#fitText" class="link">Source</a> <a href="#v:fitText" class="selflink">#</a></p><div class="doc"><p>General-purpose wide-char-aware single-line text layout function.
 It can left- or right-pad a short string to a minimum width.
 It can left- or right-clip a long string to a maximum width, optionally inserting an ellipsis (the third argument).
 It clips and pads on the right when the fourth argument is true, otherwise on the left.
 It treats wide characters as double width.</p></div></div><div class="top"><p class="src"><a id="v:textPadLeftWide" class="def">textPadLeftWide</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/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#textPadLeftWide" class="link">Source</a> <a href="#v:textPadLeftWide" class="selflink">#</a></p><div class="doc"><p>Left-pad a text to the specified width.
 Treats wide characters as double width.
 Works on multi-line texts too (but will rewrite non-unix line endings).</p></div></div><div class="top"><p class="src"><a id="v:textPadRightWide" class="def">textPadRightWide</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/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#textPadRightWide" class="link">Source</a> <a href="#v:textPadRightWide" class="selflink">#</a></p><div class="doc"><p>Right-pad a string to the specified width.
 Treats wide characters as double width.
 Works on multi-line strings too (but will rewrite non-unix line endings).</p></div></div><div class="top"><p class="src"><a id="v:textTakeWidth" class="def">textTakeWidth</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/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Hledger-Utils-Text.html#textTakeWidth" class="link">Source</a> <a href="#v:textTakeWidth" class="selflink">#</a></p><div class="doc"><p>Double-width-character-aware string truncation. Take as many
 characters as possible from a string without exceeding the
 specified width. Eg textTakeWidth 3 &quot;&#12426;&#12435;&#12372;&quot; = &quot;&#12426;&quot;.</p></div></div><div class="top"><p class="src"><a id="v:textWidth" class="def">textWidth</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="src/Hledger-Utils-Text.html#textWidth" class="link">Source</a> <a href="#v:textWidth" class="selflink">#</a></p><div class="doc"><p>Calculate the designated render width of a string, taking into
 account wide characters and line breaks (the longest line within a
 multi-line string determines the width ).</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>