/usr/share/doc/libghc-text-icu-doc/html/src/Data-Text-ICU.html is in libghc-text-icu-doc 0.7.0.1-4build1.
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!-- Generated by HsColour, http://code.haskell.org/~malcolm/hscolour/ -->
<title>Data/Text/ICU.hs</title>
<link type='text/css' rel='stylesheet' href='hscolour.css' />
</head>
<body>
<pre><a name="line-1"></a><span class='hs-comment'>{-# LANGUAGE CPP, NoImplicitPrelude #-}</span>
<a name="line-2"></a><span class='hs-comment'>-- |</span>
<a name="line-3"></a><span class='hs-comment'>-- Module : Data.Text.ICU</span>
<a name="line-4"></a><span class='hs-comment'>-- Copyright : (c) 2010 Bryan O'Sullivan</span>
<a name="line-5"></a><span class='hs-comment'>--</span>
<a name="line-6"></a><span class='hs-comment'>-- License : BSD-style</span>
<a name="line-7"></a><span class='hs-comment'>-- Maintainer : bos@serpentine.com</span>
<a name="line-8"></a><span class='hs-comment'>-- Stability : experimental</span>
<a name="line-9"></a><span class='hs-comment'>-- Portability : GHC</span>
<a name="line-10"></a><span class='hs-comment'>--</span>
<a name="line-11"></a><span class='hs-comment'>-- Commonly used functions for Unicode, implemented as bindings to the</span>
<a name="line-12"></a><span class='hs-comment'>-- International Components for Unicode (ICU) libraries.</span>
<a name="line-13"></a><span class='hs-comment'>--</span>
<a name="line-14"></a><span class='hs-comment'>-- This module contains only the most commonly used types and</span>
<a name="line-15"></a><span class='hs-comment'>-- functions. Other modules in this package expose richer interfaces.</span>
<a name="line-16"></a><span class='hs-keyword'>module</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>ICU</span>
<a name="line-17"></a> <span class='hs-layout'>(</span>
<a name="line-18"></a> <span class='hs-comment'>-- * Data representation</span>
<a name="line-19"></a> <span class='hs-comment'>-- $data</span>
<a name="line-20"></a>
<a name="line-21"></a> <span class='hs-comment'>-- * Types</span>
<a name="line-22"></a> <span class='hs-conid'>LocaleName</span><span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span>
<a name="line-23"></a> <span class='hs-comment'>-- * Boundary analysis</span>
<a name="line-24"></a> <span class='hs-comment'>-- $break</span>
<a name="line-25"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Breaker</span>
<a name="line-26"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Break</span>
<a name="line-27"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>brkPrefix</span>
<a name="line-28"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>brkBreak</span>
<a name="line-29"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>brkSuffix</span>
<a name="line-30"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>brkStatus</span>
<a name="line-31"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Line</span><span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span>
<a name="line-32"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Word</span><span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span>
<a name="line-33"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>breakCharacter</span>
<a name="line-34"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>breakLine</span>
<a name="line-35"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>breakSentence</span>
<a name="line-36"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>breakWord</span>
<a name="line-37"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>breaks</span>
<a name="line-38"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>breaksRight</span>
<a name="line-39"></a> <span class='hs-comment'>-- * Case mapping</span>
<a name="line-40"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>toCaseFold</span>
<a name="line-41"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>toLower</span>
<a name="line-42"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>toUpper</span>
<a name="line-43"></a> <span class='hs-comment'>-- * Iteration</span>
<a name="line-44"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>CharIterator</span>
<a name="line-45"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>fromString</span>
<a name="line-46"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>fromText</span>
<a name="line-47"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>fromUtf8</span>
<a name="line-48"></a> <span class='hs-comment'>-- * Normalization</span>
<a name="line-49"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>NormalizationMode</span><span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span>
<a name="line-50"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>normalize</span>
<a name="line-51"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>quickCheck</span>
<a name="line-52"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>isNormalized</span>
<a name="line-53"></a> <span class='hs-comment'>-- * String comparison</span>
<a name="line-54"></a> <span class='hs-comment'>-- ** Normalization-sensitive string comparison</span>
<a name="line-55"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>CompareOption</span><span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span>
<a name="line-56"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>compare</span>
<a name="line-57"></a> <span class='hs-comment'>-- ** Locale-sensitive string collation</span>
<a name="line-58"></a> <span class='hs-comment'>-- $collate</span>
<a name="line-59"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Collator</span>
<a name="line-60"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>collator</span>
<a name="line-61"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>collatorWith</span>
<a name="line-62"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>collate</span>
<a name="line-63"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>collateIter</span>
<a name="line-64"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>sortKey</span>
<a name="line-65"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>uca</span>
<a name="line-66"></a> <span class='hs-comment'>-- * Regular expressions</span>
<a name="line-67"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>MatchOption</span><span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span>
<a name="line-68"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>ParseError</span><span class='hs-layout'>(</span><span class='hs-varid'>errError</span><span class='hs-layout'>,</span> <span class='hs-varid'>errLine</span><span class='hs-layout'>,</span> <span class='hs-varid'>errOffset</span><span class='hs-layout'>)</span>
<a name="line-69"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Match</span>
<a name="line-70"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Regex</span>
<a name="line-71"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Regular</span>
<a name="line-72"></a> <span class='hs-comment'>-- ** Construction</span>
<a name="line-73"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>regex</span>
<a name="line-74"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>regex'</span>
<a name="line-75"></a> <span class='hs-comment'>-- ** Inspection</span>
<a name="line-76"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>pattern</span>
<a name="line-77"></a> <span class='hs-comment'>-- ** Searching</span>
<a name="line-78"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>find</span>
<a name="line-79"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>findAll</span>
<a name="line-80"></a> <span class='hs-comment'>-- ** Match groups</span>
<a name="line-81"></a> <span class='hs-comment'>-- $group</span>
<a name="line-82"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>groupCount</span>
<a name="line-83"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>unfold</span>
<a name="line-84"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>span</span>
<a name="line-85"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>group</span>
<a name="line-86"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>prefix</span>
<a name="line-87"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>suffix</span>
<a name="line-88"></a> <span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-89"></a>
<a name="line-90"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>ICU</span><span class='hs-varop'>.</span><span class='hs-conid'>Break</span><span class='hs-varop'>.</span><span class='hs-conid'>Pure</span>
<a name="line-91"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>ICU</span><span class='hs-varop'>.</span><span class='hs-conid'>Collate</span><span class='hs-varop'>.</span><span class='hs-conid'>Pure</span>
<a name="line-92"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>ICU</span><span class='hs-varop'>.</span><span class='hs-conid'>Internal</span>
<a name="line-93"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>ICU</span><span class='hs-varop'>.</span><span class='hs-conid'>Iterator</span>
<a name="line-94"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>ICU</span><span class='hs-varop'>.</span><span class='hs-conid'>Normalize</span>
<a name="line-95"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>ICU</span><span class='hs-varop'>.</span><span class='hs-conid'>Regex</span><span class='hs-varop'>.</span><span class='hs-conid'>Pure</span>
<a name="line-96"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>ICU</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span>
<a name="line-97"></a><span class='hs-cpp'>#if defined(__HADDOCK__)</span>
<a name="line-98"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>Foreign</span>
<a name="line-99"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span> <span class='hs-layout'>(</span><span class='hs-conid'>Text</span><span class='hs-layout'>)</span>
<a name="line-100"></a><span class='hs-cpp'>#endif</span>
<a name="line-101"></a>
<a name="line-102"></a><span class='hs-comment'>-- $data</span>
<a name="line-103"></a><span class='hs-comment'>--</span>
<a name="line-104"></a><span class='hs-comment'>-- The Haskell 'Text' type is implemented as an array in the Haskell</span>
<a name="line-105"></a><span class='hs-comment'>-- heap. This means that its location is not pinned; it may be copied</span>
<a name="line-106"></a><span class='hs-comment'>-- during a garbage collection pass. ICU, on the other hand, works</span>
<a name="line-107"></a><span class='hs-comment'>-- with strings that are allocated in the normal system heap and have</span>
<a name="line-108"></a><span class='hs-comment'>-- a fixed address.</span>
<a name="line-109"></a><span class='hs-comment'>--</span>
<a name="line-110"></a><span class='hs-comment'>-- To accommodate this need, these bindings use the functions from</span>
<a name="line-111"></a><span class='hs-comment'>-- "Data.Text.Foreign" to copy data between the Haskell heap and the</span>
<a name="line-112"></a><span class='hs-comment'>-- system heap. The copied strings are still managed automatically,</span>
<a name="line-113"></a><span class='hs-comment'>-- but the need to duplicate data does add some performance and memory</span>
<a name="line-114"></a><span class='hs-comment'>-- overhead.</span>
<a name="line-115"></a>
<a name="line-116"></a><span class='hs-comment'>-- $break</span>
<a name="line-117"></a><span class='hs-comment'>--</span>
<a name="line-118"></a><span class='hs-comment'>-- Text boundary analysis is the process of locating linguistic</span>
<a name="line-119"></a><span class='hs-comment'>-- boundaries while formatting and handling text. Examples of this</span>
<a name="line-120"></a><span class='hs-comment'>-- process include:</span>
<a name="line-121"></a><span class='hs-comment'>--</span>
<a name="line-122"></a><span class='hs-comment'>-- * Locating appropriate points to word-wrap text to fit within</span>
<a name="line-123"></a><span class='hs-comment'>-- specific margins while displaying or printing.</span>
<a name="line-124"></a><span class='hs-comment'>--</span>
<a name="line-125"></a><span class='hs-comment'>-- * Counting characters, words, sentences, or paragraphs.</span>
<a name="line-126"></a><span class='hs-comment'>--</span>
<a name="line-127"></a><span class='hs-comment'>-- * Making a list of the unique words in a document.</span>
<a name="line-128"></a><span class='hs-comment'>--</span>
<a name="line-129"></a><span class='hs-comment'>-- * Figuring out if a given range of text contains only whole words.</span>
<a name="line-130"></a><span class='hs-comment'>--</span>
<a name="line-131"></a><span class='hs-comment'>-- * Capitalizing the first letter of each word.</span>
<a name="line-132"></a><span class='hs-comment'>--</span>
<a name="line-133"></a><span class='hs-comment'>-- * Locating a particular unit of the text (For example, finding the</span>
<a name="line-134"></a><span class='hs-comment'>-- third word in the document).</span>
<a name="line-135"></a><span class='hs-comment'>--</span>
<a name="line-136"></a><span class='hs-comment'>-- The 'Breaker' type was designed to support these kinds of</span>
<a name="line-137"></a><span class='hs-comment'>-- tasks.</span>
<a name="line-138"></a><span class='hs-comment'>--</span>
<a name="line-139"></a><span class='hs-comment'>-- For the impure boundary analysis API (which is richer, but less</span>
<a name="line-140"></a><span class='hs-comment'>-- easy to use than the pure API), see the "Data.Text.ICU.Break"</span>
<a name="line-141"></a><span class='hs-comment'>-- module. The impure API supports some uses that may be less</span>
<a name="line-142"></a><span class='hs-comment'>-- efficient via the pure API, including:</span>
<a name="line-143"></a><span class='hs-comment'>--</span>
<a name="line-144"></a><span class='hs-comment'>-- * Locating the beginning of a word that the user has selected.</span>
<a name="line-145"></a><span class='hs-comment'>--</span>
<a name="line-146"></a><span class='hs-comment'>-- * Determining how far to move the text cursor when the user hits an</span>
<a name="line-147"></a><span class='hs-comment'>-- arrow key (Some characters require more than one position in the</span>
<a name="line-148"></a><span class='hs-comment'>-- text store and some characters in the text store do not display</span>
<a name="line-149"></a><span class='hs-comment'>-- at all).</span>
<a name="line-150"></a>
<a name="line-151"></a><span class='hs-comment'>-- $collate</span>
<a name="line-152"></a><span class='hs-comment'>--</span>
<a name="line-153"></a><span class='hs-comment'>-- For the impure collation API (which is richer, but less easy to</span>
<a name="line-154"></a><span class='hs-comment'>-- use than the pure API), see the "Data.Text.ICU.Collate"</span>
<a name="line-155"></a><span class='hs-comment'>-- module.</span>
<a name="line-156"></a>
<a name="line-157"></a><span class='hs-comment'>-- $group</span>
<a name="line-158"></a><span class='hs-comment'>--</span>
<a name="line-159"></a><span class='hs-comment'>-- Capturing groups are numbered starting from zero. Group zero is</span>
<a name="line-160"></a><span class='hs-comment'>-- always the entire matching text. Groups greater than zero contain</span>
<a name="line-161"></a><span class='hs-comment'>-- the text matching each capturing group in a regular expression.</span>
</pre></body>
</html>
|