This file is indexed.

/usr/share/doc/libghc-attoparsec-doc/html/Data-Attoparsec-Text.html is in libghc-attoparsec-doc 0.13.1.0-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
 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
173
174
175
176
177
178
<!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.Attoparsec.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_Data-Attoparsec-Text.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Attoparsec-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">attoparsec-0.13.1.0: Fast combinator parsing for bytestrings and text</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>Bryan O'Sullivan 2007-2015</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>bos@serpentine.com</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Portability</th><td>unknown</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Data.Attoparsec.Text</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Differences from Parsec</a></li><li><a href="#g:2">Incremental input</a></li><li><a href="#g:3">Performance considerations</a></li><li><a href="#g:4">Parser types</a></li><li><a href="#g:5">Running parsers</a><ul><li><a href="#g:6">Result conversion</a></li></ul></li><li><a href="#g:7">Parsing individual characters</a><ul><li><a href="#g:8">Lookahead</a></li><li><a href="#g:9">Special character parsers</a></li><li><a href="#g:10">Character classes</a></li></ul></li><li><a href="#g:11">Efficient string handling</a><ul><li><a href="#g:12">String combinators</a></li><li><a href="#g:13">Consume all remaining input</a></li></ul></li><li><a href="#g:14">Text parsing</a></li><li><a href="#g:15">Numeric parsers</a></li><li><a href="#g:16">Combinators</a></li><li><a href="#g:17">State observation and manipulation functions</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Simple, efficient combinator parsing for <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code> strings,
 loosely based on the Parsec library.</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">type</span> <a href="#t:Parser">Parser</a> = <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:Result">Result</a> = <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:IResult">IResult</a> i r<ul class="subs"><li>= <a href="#v:Fail">Fail</a> i [<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>| <a href="#v:Partial">Partial</a> (i -&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r)</li><li>| <a href="#v:Done">Done</a> i r</li></ul></li><li class="src short"><a href="#v:compareResults">compareResults</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> i, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> r) =&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r -&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <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:parse">parse</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Result">Result</a> a</li><li class="src short"><a href="#v:feed">feed</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> i =&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r -&gt; i -&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r</li><li class="src short"><a href="#v:parseOnly">parseOnly</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> 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/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/Data-String.html#t:String">String</a> a</li><li class="src short"><a href="#v:parseWith">parseWith</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; m <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; m (<a href="Data-Attoparsec-Text.html#t:Result">Result</a> a)</li><li class="src short"><a href="#v:parseTest">parseTest</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> a =&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> 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/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:maybeResult">maybeResult</a> :: <a href="Data-Attoparsec-Text.html#t:Result">Result</a> r -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> r</li><li class="src short"><a href="#v:eitherResult">eitherResult</a> :: <a href="Data-Attoparsec-Text.html#t:Result">Result</a> r -&gt; <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/Data-String.html#t:String">String</a> r</li><li class="src short"><a href="#v:char">char</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:anyChar">anyChar</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:notChar">notChar</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:satisfy">satisfy</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:satisfyWith">satisfyWith</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; a) -&gt; (a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:skip">skip</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> ()</li><li class="src short"><a href="#v:peekChar">peekChar</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a>)</li><li class="src short"><a href="#v:peekChar-39-">peekChar'</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:digit">digit</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:letter">letter</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:space">space</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:inClass">inClass</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-Char.html#t:Char">Char</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:notInClass">notInClass</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-Char.html#t:Char">Char</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:string">string</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <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:stringCI">stringCI</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <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:asciiCI">asciiCI</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <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:skipSpace">skipSpace</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> ()</li><li class="src short"><a href="#v:skipWhile">skipWhile</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> ()</li><li class="src short"><a href="#v:scan">scan</a> :: s -&gt; (s -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> s) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <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:runScanner">runScanner</a> :: s -&gt; (s -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> s) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> (<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a>, s)</li><li class="src short"><a href="#v:take">take</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="Data-Attoparsec-Text.html#t:Parser">Parser</a> <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:takeWhile">takeWhile</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <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:takeWhile1">takeWhile1</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <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:takeTill">takeTill</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <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:.-42--62-">(.*&gt;)</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:-60--42-.">(&lt;*.)</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:takeText">takeText</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <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:takeLazyText">takeLazyText</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a></li><li class="src short"><a href="#v:endOfLine">endOfLine</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> ()</li><li class="src short"><a href="#v:isEndOfLine">isEndOfLine</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</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:isHorizontalSpace">isHorizontalSpace</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</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:decimal">decimal</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:hexadecimal">hexadecimal</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integral">Integral</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bits.html#t:Bits">Bits</a> a) =&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:signed">signed</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Num">Num</a> a =&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:double">double</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Double">Double</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Number">Number</a><ul class="subs"><li>= <a href="#v:I">I</a> !<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integer">Integer</a></li><li>| <a href="#v:D">D</a> !<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Double">Double</a></li></ul></li><li class="src short"><a href="#v:number">number</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="Data-Attoparsec-Text.html#t:Number">Number</a></li><li class="src short"><a href="#v:rational">rational</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Fractional">Fractional</a> a =&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:scientific">scientific</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-scientific-doc/html/Data-Scientific.html#t:Scientific">Scientific</a></li><li class="src short"><a href="#v:try">try</a> :: <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> i a -&gt; <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> i a</li><li class="src short"><a href="#v:-60--63--62-">(&lt;?&gt;)</a> :: <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> i 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="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> i a</li><li class="src short"><a href="#v:choice">choice</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; [f a] -&gt; f a</li><li class="src short"><a href="#v:count">count</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; m a -&gt; m [a]</li><li class="src short"><a href="#v:option">option</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; a -&gt; f a -&gt; f a</li><li class="src short"><a href="#v:many-39-">many'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; m a -&gt; m [a]</li><li class="src short"><a href="#v:many1">many1</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f [a]</li><li class="src short"><a href="#v:many1-39-">many1'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; m a -&gt; m [a]</li><li class="src short"><a href="#v:manyTill">manyTill</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f b -&gt; f [a]</li><li class="src short"><a href="#v:manyTill-39-">manyTill'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; m a -&gt; m b -&gt; m [a]</li><li class="src short"><a href="#v:sepBy">sepBy</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f s -&gt; f [a]</li><li class="src short"><a href="#v:sepBy-39-">sepBy'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; m a -&gt; m s -&gt; m [a]</li><li class="src short"><a href="#v:sepBy1">sepBy1</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f s -&gt; f [a]</li><li class="src short"><a href="#v:sepBy1-39-">sepBy1'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; m a -&gt; m s -&gt; m [a]</li><li class="src short"><a href="#v:skipMany">skipMany</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f ()</li><li class="src short"><a href="#v:skipMany1">skipMany1</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f ()</li><li class="src short"><a href="#v:eitherP">eitherP</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f b -&gt; f (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> a b)</li><li class="src short"><a href="#v:match">match</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> (<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a>, a)</li><li class="src short"><a href="#v:endOfInput">endOfInput</a> :: <span class="keyword">forall</span> t. <a href="Data-Attoparsec-Internal-Types.html#t:Chunk">Chunk</a> t =&gt; <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> t ()</li><li class="src short"><a href="#v:atEnd">atEnd</a> :: <a href="Data-Attoparsec-Internal-Types.html#t:Chunk">Chunk</a> t =&gt; <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> t <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li></ul></div><div id="interface"><h1 id="g:1">Differences from Parsec</h1><div class="doc"><p>Compared to Parsec 3, attoparsec makes several tradeoffs.  It is
 not intended for, or ideal for, all possible uses.</p><ul><li>While attoparsec can consume input incrementally, Parsec cannot.
   Incremental input is a huge deal for efficient and secure network
   and system programming, since it gives much more control to users
   of the library over matters such as resource usage and the I/O
   model to use.</li><li>Much of the performance advantage of attoparsec is gained via
   high-performance parsers such as <code><a href="Data-Attoparsec-Text.html#v:takeWhile">takeWhile</a></code> and <code><a href="Data-Attoparsec-Text.html#v:string">string</a></code>.
   If you use complicated combinators that return lists of
   characters, there is less performance difference between the two
   libraries.</li><li>Unlike Parsec 3, attoparsec does not support being used as a
   monad transformer.</li><li>attoparsec is specialised to deal only with strict <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code>
   input.  Efficiency concerns rule out both lists and lazy text.
   The usual use for lazy text would be to allow consumption of very
   large input without a large footprint.  For this need,
   attoparsec's incremental input provides an excellent substitute,
   with much more control over when input takes place.  If you must
   use lazy text, see the <code>Lazy</code> module, which feeds lazy chunks to
   a regular parser.</li><li>Parsec parsers can produce more helpful error messages than
   attoparsec parsers.  This is a matter of focus: attoparsec avoids
   the extra book-keeping in favour of higher performance.</li></ul></div><h1 id="g:2">Incremental input</h1><div class="doc"><p>attoparsec supports incremental input, meaning that you can feed it
 a <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code> that represents only part of the expected total amount
 of data to parse. If your parser reaches the end of a fragment of
 input and could consume more input, it will suspend parsing and
 return a <code><a href="Data-Attoparsec-Text.html#v:Partial">Partial</a></code> continuation.</p><p>Supplying the <code><a href="Data-Attoparsec-Text.html#v:Partial">Partial</a></code> continuation with another string will
 resume parsing at the point where it was suspended, with the string
 you supplied used as new input at the end of the existing
 input. You must be prepared for the result of the resumed parse to
 be another <code>Partial</code> continuation.</p><p>To indicate that you have no more input, supply the <code>Partial</code>
 continuation with an <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#v:empty">empty</a></code> <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code>.</p><p>Remember that some parsing combinators will not return a result
 until they reach the end of input.  They may thus cause <code><a href="Data-Attoparsec-Text.html#v:Partial">Partial</a></code>
 results to be returned.</p><p>If you do not need support for incremental input, consider using
 the <code><a href="Data-Attoparsec-Text.html#v:parseOnly">parseOnly</a></code> function to run your parser.  It will never
 prompt for more input.</p><p><em>Note</em>: incremental input does <em>not</em> imply that attoparsec will
 release portions of its internal state for garbage collection as it
 proceeds.  Its internal representation is equivalent to a single
 <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code>: if you feed incremental input to an a parser, it will
 require memory proportional to the amount of input you supply.
 (This is necessary to support arbitrary backtracking.)</p></div><h1 id="g:3">Performance considerations</h1><div class="doc"><p>If you write an attoparsec-based parser carefully, it can be
 realistic to expect it to perform similarly to a hand-rolled C
 parser (measuring megabytes parsed per second).</p><p>To actually achieve high performance, there are a few guidelines
 that it is useful to follow.</p><p>Use the <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code>-oriented parsers whenever possible,
 e.g. <code><a href="Data-Attoparsec-Text.html#v:takeWhile1">takeWhile1</a></code> instead of <code><a href="Data-Attoparsec-Text.html#v:many1">many1</a></code> <code><a href="Data-Attoparsec-Text.html#v:anyChar">anyChar</a></code>.  There is
 about a factor of 100 difference in performance between the two
 kinds of parser.</p><p>For very simple character-testing predicates, write them by hand
 instead of using <code><a href="Data-Attoparsec-Text.html#v:inClass">inClass</a></code> or <code><a href="Data-Attoparsec-Text.html#v:notInClass">notInClass</a></code>.  For instance, both
 of these predicates test for an end-of-line character, but the
 first is much faster than the second:</p><pre>endOfLine_fast c = c == '\r' || c == '\n'
endOfLine_slow   = inClass &quot;\r\n&quot;</pre><p>Make active use of benchmarking and profiling tools to measure,
 find the problems with, and improve the performance of your parser.</p></div><h1 id="g:4">Parser types</h1><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:Parser" class="def">Parser</a> = <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#Parser" class="link">Source</a> <a href="#t:Parser" class="selflink">#</a></p></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:Result" class="def">Result</a> = <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#Result" class="link">Source</a> <a href="#t:Result" class="selflink">#</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:IResult" class="def">IResult</a> i r <a href="src/Data-Attoparsec-Internal-Types.html#IResult" class="link">Source</a> <a href="#t:IResult" class="selflink">#</a></p><div class="doc"><p>The result of a parse.  This is parameterised over the type <code>i</code>
 of string that was processed.</p><p>This type is an instance of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a></code>, where <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#v:fmap">fmap</a></code> transforms the
 value in a <code><a href="Data-Attoparsec-Text.html#v:Done">Done</a></code> result.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Fail" class="def">Fail</a> i [<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></td><td class="doc"><p>The parse failed.  The <code>i</code> parameter is the input that had
 not yet been consumed when the failure occurred.  The
 <code>[</code><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></code><code>]</code> is a list of contexts in which the error
 occurred.  The <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></code> is the message describing the error, if
 any.</p></td></tr><tr><td class="src"><a id="v:Partial" class="def">Partial</a> (i -&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r)</td><td class="doc"><p>Supply this continuation with more input so that the parser
 can resume.  To indicate that no more input is available, pass
 an empty string to the continuation.</p><p><strong>Note</strong>: if you get a <code><a href="Data-Attoparsec-Text.html#v:Partial">Partial</a></code> result, do not call its
 continuation more than once.</p></td></tr><tr><td class="src"><a id="v:Done" class="def">Done</a> i r</td><td class="doc"><p>The parse succeeded.  The <code>i</code> parameter is the input that had
 not yet been consumed (if any) when the parse succeeded.</p></td></tr></table></div><div class="subs instances"><p id="control.i:IResult" class="caption collapser" onclick="toggleSection('i:IResult')">Instances</p><div id="section.i:IResult" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:IResult:Functor:1" class="instance expander" onclick="toggleSection('i:id:IResult:Functor:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> (<a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i)</span> <a href="src/Data-Attoparsec-Internal-Types.html#line-87" class="link">Source</a> <a href="#t:IResult" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:IResult:Functor:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fmap">fmap</a> :: (a -&gt; b) -&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i a -&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i b <a href="#v:fmap" class="selflink">#</a></p><p class="src"><a href="#v:-60--36-">(&lt;$)</a> :: a -&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i b -&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i a <a href="#v:-60--36-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:IResult:Show:2" class="instance expander" onclick="toggleSection('i:id:IResult:Show:2')"></span> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> i, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> r) =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> (<a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r)</span> <a href="src/Data-Attoparsec-Internal-Types.html#line-72" class="link">Source</a> <a href="#t:IResult" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:IResult:Show:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</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="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r -&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="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:IResult:NFData:3" class="instance expander" onclick="toggleSection('i:id:IResult:NFData:3')"></span> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> i, <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> r) =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> (<a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r)</span> <a href="src/Data-Attoparsec-Internal-Types.html#line-81" class="link">Source</a> <a href="#t:IResult" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:IResult:NFData:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:rnf">rnf</a> :: <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r -&gt; () <a href="#v:rnf" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:compareResults" class="def">compareResults</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> i, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> r) =&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r -&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <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/Data-Attoparsec-Internal.html#compareResults" class="link">Source</a> <a href="#v:compareResults" class="selflink">#</a></p><div class="doc"><p>Compare two <code><a href="Data-Attoparsec-Text.html#t:IResult">IResult</a></code> values for equality.</p><p>If both <code><a href="Data-Attoparsec-Text.html#t:IResult">IResult</a></code>s are <code><a href="Data-Attoparsec-Text.html#v:Partial">Partial</a></code>, the result will be <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Nothing">Nothing</a></code>, as
 they are incomplete and hence their equality cannot be known.
 (This is why there is no <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a></code> instance for <code><a href="Data-Attoparsec-Text.html#t:IResult">IResult</a></code>.)</p></div></div><h1 id="g:5">Running parsers</h1><div class="top"><p class="src"><a id="v:parse" class="def">parse</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Result">Result</a> a <a href="src/Data-Attoparsec-Text-Internal.html#parse" class="link">Source</a> <a href="#v:parse" class="selflink">#</a></p><div class="doc"><p>Run a parser.</p></div></div><div class="top"><p class="src"><a id="v:feed" class="def">feed</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> i =&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r -&gt; i -&gt; <a href="Data-Attoparsec-Text.html#t:IResult">IResult</a> i r <a href="src/Data-Attoparsec-Combinator.html#feed" class="link">Source</a> <a href="#v:feed" class="selflink">#</a></p><div class="doc"><p>If a parser has returned a <code><a href="T.html#v:Partial">Partial</a></code> result, supply it with more
 input.</p></div></div><div class="top"><p class="src"><a id="v:parseOnly" class="def">parseOnly</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> 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/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/Data-String.html#t:String">String</a> a <a href="src/Data-Attoparsec-Text-Internal.html#parseOnly" class="link">Source</a> <a href="#v:parseOnly" class="selflink">#</a></p><div class="doc"><p>Run a parser that cannot be resupplied via a <code><a href="Data-Attoparsec-Text.html#v:Partial">Partial</a></code> result.</p><p>This function does not force a parser to consume all of its input.
 Instead, any residual input will be discarded.  To force a parser
 to consume all of its input, use something like this:</p><pre><code><a href="Data-Attoparsec-Text.html#v:parseOnly">parseOnly</a></code> (myParser <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:-60--42-">&lt;*</a></code> <code><a href="Data-Attoparsec-Text.html#v:endOfInput">endOfInput</a></code>)
 </pre></div></div><div class="top"><p class="src"><a id="v:parseWith" class="def">parseWith</a> <a href="src/Data-Attoparsec-Text.html#parseWith" class="link">Source</a> <a href="#v:parseWith" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> m</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; m <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></td><td class="doc"><p>An action that will be executed to provide the parser
 with more input, if necessary.  The action must return an
 <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#v:empty">empty</a></code> string when there is no more input available.</p></td></tr><tr><td class="src">-&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></td><td class="doc"><p>Initial input for the parser.</p></td></tr><tr><td class="src">-&gt; m (<a href="Data-Attoparsec-Text.html#t:Result">Result</a> a)</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Run a parser with an initial input string, and a monadic action
 that can supply more input if needed.</p></div></div><div class="top"><p class="src"><a id="v:parseTest" class="def">parseTest</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> a =&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> 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/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> () <a href="src/Data-Attoparsec-Text.html#parseTest" class="link">Source</a> <a href="#v:parseTest" class="selflink">#</a></p><div class="doc"><p>Run a parser and print its result to standard output.</p></div></div><h2 id="g:6">Result conversion</h2><div class="top"><p class="src"><a id="v:maybeResult" class="def">maybeResult</a> :: <a href="Data-Attoparsec-Text.html#t:Result">Result</a> r -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> r <a href="src/Data-Attoparsec-Text.html#maybeResult" class="link">Source</a> <a href="#v:maybeResult" class="selflink">#</a></p><div class="doc"><p>Convert a <code><a href="Data-Attoparsec-Text.html#t:Result">Result</a></code> value to a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a></code> value. A <code>Partial</code> result
 is treated as failure.</p></div></div><div class="top"><p class="src"><a id="v:eitherResult" class="def">eitherResult</a> :: <a href="Data-Attoparsec-Text.html#t:Result">Result</a> r -&gt; <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/Data-String.html#t:String">String</a> r <a href="src/Data-Attoparsec-Text.html#eitherResult" class="link">Source</a> <a href="#v:eitherResult" class="selflink">#</a></p><div class="doc"><p>Convert a <code><a href="Data-Attoparsec-Text.html#t:Result">Result</a></code> value to an <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a></code> value. A <code>Partial</code> result
 is treated as failure.</p></div></div><h1 id="g:7">Parsing individual characters</h1><div class="top"><p class="src"><a id="v:char" class="def">char</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="src/Data-Attoparsec-Text-Internal.html#char" class="link">Source</a> <a href="#v:char" class="selflink">#</a></p><div class="doc"><p>Match a specific character.</p></div></div><div class="top"><p class="src"><a id="v:anyChar" class="def">anyChar</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="src/Data-Attoparsec-Text-Internal.html#anyChar" class="link">Source</a> <a href="#v:anyChar" class="selflink">#</a></p><div class="doc"><p>Match any character.</p></div></div><div class="top"><p class="src"><a id="v:notChar" class="def">notChar</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="src/Data-Attoparsec-Text-Internal.html#notChar" class="link">Source</a> <a href="#v:notChar" class="selflink">#</a></p><div class="doc"><p>Match any character except the given one.</p></div></div><div class="top"><p class="src"><a id="v:satisfy" class="def">satisfy</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="src/Data-Attoparsec-Text-Internal.html#satisfy" class="link">Source</a> <a href="#v:satisfy" class="selflink">#</a></p><div class="doc"><p>The parser <code>satisfy p</code> succeeds for any character for which the
 predicate <code>p</code> returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code>. Returns the character that is
 actually parsed.</p><pre>digit = satisfy isDigit
    where isDigit c = c &gt;= '0' &amp;&amp; c &lt;= '9'</pre></div></div><div class="top"><p class="src"><a id="v:satisfyWith" class="def">satisfyWith</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; a) -&gt; (a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a <a href="src/Data-Attoparsec-Text-Internal.html#satisfyWith" class="link">Source</a> <a href="#v:satisfyWith" class="selflink">#</a></p><div class="doc"><p>The parser <code>satisfyWith f p</code> transforms a character, and succeeds
 if the predicate <code>p</code> returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code> on the transformed value. The
 parser returns the transformed character that was parsed.</p></div></div><div class="top"><p class="src"><a id="v:skip" class="def">skip</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> () <a href="src/Data-Attoparsec-Text-Internal.html#skip" class="link">Source</a> <a href="#v:skip" class="selflink">#</a></p><div class="doc"><p>The parser <code>skip p</code> succeeds for any character for which the
 predicate <code>p</code> returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code>.</p><pre>skipDigit = skip isDigit
    where isDigit c = c &gt;= '0' &amp;&amp; c &lt;= '9'</pre></div></div><h2 id="g:8">Lookahead</h2><div class="top"><p class="src"><a id="v:peekChar" class="def">peekChar</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a>) <a href="src/Data-Attoparsec-Text-Internal.html#peekChar" class="link">Source</a> <a href="#v:peekChar" class="selflink">#</a></p><div class="doc"><p>Match any character, to perform lookahead. Returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Nothing">Nothing</a></code> if
 end of input has been reached. Does not consume any input.</p><p><em>Note</em>: Because this parser does not fail, do not use it with
 combinators such as <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:many">many</a></code>, because such
 parsers loop until a failure occurs.  Careless use will thus result
 in an infinite loop.</p></div></div><div class="top"><p class="src"><a id="v:peekChar-39-" class="def">peekChar'</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="src/Data-Attoparsec-Text-Internal.html#peekChar%27" class="link">Source</a> <a href="#v:peekChar-39-" class="selflink">#</a></p><div class="doc"><p>Match any character, to perform lookahead.  Does not consume any
 input, but will fail if end of input has been reached.</p></div></div><h2 id="g:9">Special character parsers</h2><div class="top"><p class="src"><a id="v:digit" class="def">digit</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="src/Data-Attoparsec-Text.html#digit" class="link">Source</a> <a href="#v:digit" class="selflink">#</a></p><div class="doc"><p>Parse a single digit, as recognised by <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#v:isDigit">isDigit</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:letter" class="def">letter</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="src/Data-Attoparsec-Text.html#letter" class="link">Source</a> <a href="#v:letter" class="selflink">#</a></p><div class="doc"><p>Parse a letter, as recognised by <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#v:isAlpha">isAlpha</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:space" class="def">space</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> <a href="src/Data-Attoparsec-Text.html#space" class="link">Source</a> <a href="#v:space" class="selflink">#</a></p><div class="doc"><p>Parse a space character, as recognised by <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#v:isSpace">isSpace</a></code>.</p></div></div><h2 id="g:10">Character classes</h2><div class="top"><p class="src"><a id="v:inClass" class="def">inClass</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-Char.html#t:Char">Char</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/Data-Attoparsec-Text-Internal.html#inClass" class="link">Source</a> <a href="#v:inClass" class="selflink">#</a></p><div class="doc"><p>Match any character in a set.</p><pre>vowel = inClass &quot;aeiou&quot;</pre><p>Range notation is supported.</p><pre>halfAlphabet = inClass &quot;a-nA-N&quot;</pre><p>To add a literal <code>'-'</code> to a set, place it at the beginning or end
 of the string.</p></div></div><div class="top"><p class="src"><a id="v:notInClass" class="def">notInClass</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-Char.html#t:Char">Char</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/Data-Attoparsec-Text-Internal.html#notInClass" class="link">Source</a> <a href="#v:notInClass" class="selflink">#</a></p><div class="doc"><p>Match any character not in a set.</p></div></div><h1 id="g:11">Efficient string handling</h1><div class="top"><p class="src"><a id="v:string" class="def">string</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#string" class="link">Source</a> <a href="#v:string" class="selflink">#</a></p><div class="doc"><p><code>string s</code> parses a sequence of characters that identically match
 <code>s</code>. Returns the parsed string (i.e. <code>s</code>).  This parser consumes no
 input if it fails (even if a partial match).</p><p><em>Note</em>: The behaviour of this parser is different to that of the
 similarly-named parser in Parsec, as this one is all-or-nothing.
 To illustrate the difference, the following parser will fail under
 Parsec given an input of <code>&quot;for&quot;</code>:</p><pre>string &quot;foo&quot; &lt;|&gt; string &quot;for&quot;</pre><p>The reason for its failure is that the first branch is a
 partial match, and will consume the letters <code>'f'</code> and <code>'o'</code>
 before failing.  In attoparsec, the above parser will <em>succeed</em> on
 that input, because the failed first branch will consume nothing.</p></div></div><div class="top"><p class="src"><a id="v:stringCI" class="def">stringCI</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#stringCI" class="link">Source</a> <a href="#v:stringCI" class="selflink">#</a></p><div class="doc"><div class="warning"><p>Deprecated: this is very inefficient, use asciiCI instead</p></div><p>Satisfy a literal string, ignoring case.</p><p>Note: this function is currently quite inefficient. Unicode case
 folding can change the length of a string (&quot;&#223;&quot; becomes
 &quot;ss&quot;), which makes a simple, efficient implementation tricky.  We
 have (for now) chosen simplicity over efficiency.</p></div></div><div class="top"><p class="src"><a id="v:asciiCI" class="def">asciiCI</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#asciiCI" class="link">Source</a> <a href="#v:asciiCI" class="selflink">#</a></p><div class="doc"><p>Satisfy a literal string, ignoring case for characters in the ASCII range.</p></div></div><div class="top"><p class="src"><a id="v:skipSpace" class="def">skipSpace</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> () <a href="src/Data-Attoparsec-Text.html#skipSpace" class="link">Source</a> <a href="#v:skipSpace" class="selflink">#</a></p><div class="doc"><p>Skip over white space.</p></div></div><div class="top"><p class="src"><a id="v:skipWhile" class="def">skipWhile</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> () <a href="src/Data-Attoparsec-Text-Internal.html#skipWhile" class="link">Source</a> <a href="#v:skipWhile" class="selflink">#</a></p><div class="doc"><p>Skip past input for as long as the predicate returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:scan" class="def">scan</a> :: s -&gt; (s -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> s) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#scan" class="link">Source</a> <a href="#v:scan" class="selflink">#</a></p><div class="doc"><p>A stateful scanner.  The predicate consumes and transforms a
 state argument, and each transformed state is passed to successive
 invocations of the predicate on each character of the input until one
 returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Nothing">Nothing</a></code> or the input ends.</p><p>This parser does not fail.  It will return an empty string if the
 predicate returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Nothing">Nothing</a></code> on the first character of input.</p><p><em>Note</em>: Because this parser does not fail, do not use it with
 combinators such as <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:many">many</a></code>, because such
 parsers loop until a failure occurs.  Careless use will thus result
 in an infinite loop.</p></div></div><div class="top"><p class="src"><a id="v:runScanner" class="def">runScanner</a> :: s -&gt; (s -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> s) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> (<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a>, s) <a href="src/Data-Attoparsec-Text-Internal.html#runScanner" class="link">Source</a> <a href="#v:runScanner" class="selflink">#</a></p><div class="doc"><p>Like <code><a href="Data-Attoparsec-Text.html#v:scan">scan</a></code>, but generalized to return the final state of the
 scanner.</p></div></div><div class="top"><p class="src"><a id="v:take" class="def">take</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="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#take" class="link">Source</a> <a href="#v:take" class="selflink">#</a></p><div class="doc"><p>Consume exactly <code>n</code> characters of input.</p></div></div><div class="top"><p class="src"><a id="v:takeWhile" class="def">takeWhile</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#takeWhile" class="link">Source</a> <a href="#v:takeWhile" class="selflink">#</a></p><div class="doc"><p>Consume input as long as the predicate returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code>, and return
 the consumed input.</p><p>This parser does not fail.  It will return an empty string if the
 predicate returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:False">False</a></code> on the first character of input.</p><p><em>Note</em>: Because this parser does not fail, do not use it with
 combinators such as <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:many">many</a></code>, because such
 parsers loop until a failure occurs.  Careless use will thus result
 in an infinite loop.</p></div></div><div class="top"><p class="src"><a id="v:takeWhile1" class="def">takeWhile1</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#takeWhile1" class="link">Source</a> <a href="#v:takeWhile1" class="selflink">#</a></p><div class="doc"><p>Consume input as long as the predicate returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code>, and return
 the consumed input.</p><p>This parser requires the predicate to succeed on at least one
 character of input: it will fail if the predicate never returns
 <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code> or if there is no input left.</p></div></div><div class="top"><p class="src"><a id="v:takeTill" class="def">takeTill</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#takeTill" class="link">Source</a> <a href="#v:takeTill" class="selflink">#</a></p><div class="doc"><p>Consume input as long as the predicate returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:False">False</a></code>
 (i.e. until it returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code>), and return the consumed input.</p><p>This parser does not fail.  It will return an empty string if the
 predicate returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code> on the first character of input.</p><p><em>Note</em>: Because this parser does not fail, do not use it with
 combinators such as <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:many">many</a></code>, because such
 parsers loop until a failure occurs.  Careless use will thus result
 in an infinite loop.</p></div></div><h2 id="g:12">String combinators</h2><div class="doc"><p>If you enable the <code>OverloadedStrings</code> language extension, you can
 use the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:-42--62-">*&gt;</a></code> and <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:-60--42-">&lt;*</a></code> combinators to simplify the common task of
 matching a statically known string, then immediately parsing
 something else.</p><p>Instead of writing something like this:</p><pre><code><a href="Data-Attoparsec-Text.html#v:string">string</a></code> &quot;foo&quot; <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:-42--62-">*&gt;</a></code> wibble
 </pre><p>Using <code>OverloadedStrings</code>, you can omit the explicit use of
 <code><a href="Data-Attoparsec-Text.html#v:string">string</a></code>, and write a more compact version:</p><pre>&quot;foo&quot; <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:-42--62-">*&gt;</a></code> wibble
</pre><p>(Note: the <code><a href="Data-Attoparsec-Text.html#v:.-42--62-">.*&gt;</a></code> and <code><a href="Data-Attoparsec-Text.html#v:-60--42-.">&lt;*.</a></code> combinators that were originally
 provided for this purpose are obsolete and unnecessary, and will be
 removed in the next major version.)</p></div><div class="top"><p class="src"><a id="v:.-42--62-" class="def">(.*&gt;)</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a <a href="src/Data-Attoparsec-Text.html#.%2A%3E" class="link">Source</a> <a href="#v:.-42--62-" class="selflink">#</a></p><div class="doc"><div class="warning"><p>Deprecated: This is no longer necessary, and will be removed. Use <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:-42--62-">*&gt;</a></code> instead.</p></div><p><em>Obsolete</em>. A type-specialized version of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:-42--62-">*&gt;</a></code> for <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code>. Use
 <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:-42--62-">*&gt;</a></code> instead.</p></div></div><div class="top"><p class="src"><a id="v:-60--42-." class="def">(&lt;*.)</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a -&gt; <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a <a href="src/Data-Attoparsec-Text.html#%3C%2A." class="link">Source</a> <a href="#v:-60--42-." class="selflink">#</a></p><div class="doc"><div class="warning"><p>Deprecated: This is no longer necessary, and will be removed. Use <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:-60--42-">&lt;*</a></code> instead.</p></div><p><em>Obsolete</em>. A type-specialized version of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:-60--42-">&lt;*</a></code> for <code><a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></code>. Use
 <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#v:-42--62-">*&gt;</a></code> instead.</p></div></div><h2 id="g:13">Consume all remaining input</h2><div class="top"><p class="src"><a id="v:takeText" class="def">takeText</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#takeText" class="link">Source</a> <a href="#v:takeText" class="selflink">#</a></p><div class="doc"><p>Consume all remaining input and return it as a single string.</p></div></div><div class="top"><p class="src"><a id="v:takeLazyText" class="def">takeLazyText</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> <a href="src/Data-Attoparsec-Text-Internal.html#takeLazyText" class="link">Source</a> <a href="#v:takeLazyText" class="selflink">#</a></p><div class="doc"><p>Consume all remaining input and return it as a single string.</p></div></div><h1 id="g:14">Text parsing</h1><div class="top"><p class="src"><a id="v:endOfLine" class="def">endOfLine</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> () <a href="src/Data-Attoparsec-Text-Internal.html#endOfLine" class="link">Source</a> <a href="#v:endOfLine" class="selflink">#</a></p><div class="doc"><p>Match either a single newline character <code>'\n'</code>, or a carriage
 return followed by a newline character <code>&quot;\r\n&quot;</code>.</p></div></div><div class="top"><p class="src"><a id="v:isEndOfLine" class="def">isEndOfLine</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</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/Data-Attoparsec-Text.html#isEndOfLine" class="link">Source</a> <a href="#v:isEndOfLine" class="selflink">#</a></p><div class="doc"><p>A predicate that matches either a carriage return <code>'\r'</code> or
 newline <code>'\n'</code> character.</p></div></div><div class="top"><p class="src"><a id="v:isHorizontalSpace" class="def">isHorizontalSpace</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Char.html#t:Char">Char</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/Data-Attoparsec-Text.html#isHorizontalSpace" class="link">Source</a> <a href="#v:isHorizontalSpace" class="selflink">#</a></p><div class="doc"><p>A predicate that matches either a space <code>' '</code> or horizontal tab
 <code>'\t'</code> character.</p></div></div><h1 id="g:15">Numeric parsers</h1><div class="top"><p class="src"><a id="v:decimal" class="def">decimal</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integral">Integral</a> a =&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a <a href="src/Data-Attoparsec-Text.html#decimal" class="link">Source</a> <a href="#v:decimal" class="selflink">#</a></p><div class="doc"><p>Parse and decode an unsigned decimal number.</p></div></div><div class="top"><p class="src"><a id="v:hexadecimal" class="def">hexadecimal</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integral">Integral</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bits.html#t:Bits">Bits</a> a) =&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a <a href="src/Data-Attoparsec-Text.html#hexadecimal" class="link">Source</a> <a href="#v:hexadecimal" class="selflink">#</a></p><div class="doc"><p>Parse and decode an unsigned hexadecimal number.  The hex digits
 <code>'a'</code> through <code>'f'</code> may be upper or lower case.</p><p>This parser does not accept a leading <code>&quot;0x&quot;</code> string.</p></div></div><div class="top"><p class="src"><a id="v:signed" class="def">signed</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Num">Num</a> a =&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a <a href="src/Data-Attoparsec-Text.html#signed" class="link">Source</a> <a href="#v:signed" class="selflink">#</a></p><div class="doc"><p>Parse a number with an optional leading <code>'+'</code> or <code>'-'</code> sign
 character.</p></div></div><div class="top"><p class="src"><a id="v:double" class="def">double</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Double">Double</a> <a href="src/Data-Attoparsec-Text.html#double" class="link">Source</a> <a href="#v:double" class="selflink">#</a></p><div class="doc"><p>Parse a rational number.</p><p>This parser accepts an optional leading sign character, followed by
 at least one decimal digit.  The syntax similar to that accepted by
 the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#v:read">read</a></code> function, with the exception that a trailing <code>'.'</code> or
 <code>'e'</code> <em>not</em> followed by a number is not consumed.</p><p>Examples with behaviour identical to <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#v:read">read</a></code>, if you feed an empty
 continuation to the first result:</p><pre>rational &quot;3&quot;     == Done 3.0 &quot;&quot;
rational &quot;3.1&quot;   == Done 3.1 &quot;&quot;
rational &quot;3e4&quot;   == Done 30000.0 &quot;&quot;
rational &quot;3.1e4&quot; == Done 31000.0, &quot;&quot;</pre><p>Examples with behaviour identical to <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#v:read">read</a></code>:</p><pre>rational &quot;.3&quot;    == Fail &quot;input does not start with a digit&quot;
rational &quot;e3&quot;    == Fail &quot;input does not start with a digit&quot;</pre><p>Examples of differences from <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#v:read">read</a></code>:</p><pre>rational &quot;3.foo&quot; == Done 3.0 &quot;.foo&quot;
rational &quot;3e&quot;    == Done 3.0 &quot;e&quot;</pre><p>This function does not accept string representations of &quot;NaN&quot; or
 &quot;Infinity&quot;.</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Number" class="def">Number</a> <a href="src/Data-Attoparsec-Number.html#Number" class="link">Source</a> <a href="#t:Number" class="selflink">#</a></p><div class="doc"><p>A numeric type that can represent integers accurately, and
 floating point numbers to the precision of a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Double">Double</a></code>.</p><p><em>Note</em>: this type is deprecated, and will be removed in the next
 major release.  Use the <code><a href="file:///usr/share/doc/libghc-scientific-doc/html/Data-Scientific.html#v:Scientific">Scientific</a></code> type instead.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:I" class="def">I</a> !<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integer">Integer</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:D" class="def">D</a> !<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Double">Double</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:Number" class="caption collapser" onclick="toggleSection('i:Number')">Instances</p><div id="section.i:Number" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Number:Eq:1" class="instance expander" onclick="toggleSection('i:id:Number:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> <a href="Data-Attoparsec-Text.html#t:Number">Number</a></span> <a href="src/Data-Attoparsec-Number.html#line-56" class="link">Source</a> <a href="#t:Number" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Number:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</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="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</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="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Number:Fractional:2" class="instance expander" onclick="toggleSection('i:id:Number:Fractional:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Fractional">Fractional</a> <a href="Data-Attoparsec-Text.html#t:Number">Number</a></span> <a href="src/Data-Attoparsec-Number.html#line-109" class="link">Source</a> <a href="#t:Number" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Number:Fractional:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-47-">(/)</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:-47-" class="selflink">#</a></p><p class="src"><a href="#v:recip">recip</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:recip" class="selflink">#</a></p><p class="src"><a href="#v:fromRational">fromRational</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Rational">Rational</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:fromRational" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Number:Data:3" class="instance expander" onclick="toggleSection('i:id:Number:Data:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> <a href="Data-Attoparsec-Text.html#t:Number">Number</a></span> <a href="src/Data-Attoparsec-Number.html#line-36" class="link">Source</a> <a href="#t:Number" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Number:Data:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:gfoldl">gfoldl</a> :: (<span class="keyword">forall</span> d b. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> d =&gt; c (d -&gt; b) -&gt; d -&gt; c b) -&gt; (<span class="keyword">forall</span> g. g -&gt; c g) -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; c <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:gfoldl" class="selflink">#</a></p><p class="src"><a href="#v:gunfold">gunfold</a> :: (<span class="keyword">forall</span> b r. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> b =&gt; c (b -&gt; r) -&gt; c r) -&gt; (<span class="keyword">forall</span> r. r -&gt; c r) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Constr">Constr</a> -&gt; c <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:gunfold" class="selflink">#</a></p><p class="src"><a href="#v:toConstr">toConstr</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Constr">Constr</a> <a href="#v:toConstr" class="selflink">#</a></p><p class="src"><a href="#v:dataTypeOf">dataTypeOf</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:DataType">DataType</a> <a href="#v:dataTypeOf" class="selflink">#</a></p><p class="src"><a href="#v:dataCast1">dataCast1</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Typeable-Internal.html#t:Typeable">Typeable</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a>) t =&gt; (<span class="keyword">forall</span> d. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> d =&gt; c (t d)) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (c <a href="Data-Attoparsec-Text.html#t:Number">Number</a>) <a href="#v:dataCast1" class="selflink">#</a></p><p class="src"><a href="#v:dataCast2">dataCast2</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Typeable-Internal.html#t:Typeable">Typeable</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a>) t =&gt; (<span class="keyword">forall</span> d e. (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> d, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> e) =&gt; c (t d e)) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (c <a href="Data-Attoparsec-Text.html#t:Number">Number</a>) <a href="#v:dataCast2" class="selflink">#</a></p><p class="src"><a href="#v:gmapT">gmapT</a> :: (<span class="keyword">forall</span> b. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> b =&gt; b -&gt; b) -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:gmapT" class="selflink">#</a></p><p class="src"><a href="#v:gmapQl">gmapQl</a> :: (r -&gt; r' -&gt; r) -&gt; r -&gt; (<span class="keyword">forall</span> d. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> d =&gt; d -&gt; r') -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; r <a href="#v:gmapQl" class="selflink">#</a></p><p class="src"><a href="#v:gmapQr">gmapQr</a> :: (r' -&gt; r -&gt; r) -&gt; r -&gt; (<span class="keyword">forall</span> d. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> d =&gt; d -&gt; r') -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; r <a href="#v:gmapQr" class="selflink">#</a></p><p class="src"><a href="#v:gmapQ">gmapQ</a> :: (<span class="keyword">forall</span> d. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> d =&gt; d -&gt; u) -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; [u] <a href="#v:gmapQ" class="selflink">#</a></p><p class="src"><a href="#v:gmapQi">gmapQi</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; (<span class="keyword">forall</span> d. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> d =&gt; d -&gt; u) -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; u <a href="#v:gmapQi" class="selflink">#</a></p><p class="src"><a href="#v:gmapM">gmapM</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; (<span class="keyword">forall</span> d. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> d =&gt; d -&gt; m d) -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; m <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:gmapM" class="selflink">#</a></p><p class="src"><a href="#v:gmapMp">gmapMp</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; (<span class="keyword">forall</span> d. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> d =&gt; d -&gt; m d) -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; m <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:gmapMp" class="selflink">#</a></p><p class="src"><a href="#v:gmapMo">gmapMo</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; (<span class="keyword">forall</span> d. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Data.html#t:Data">Data</a> d =&gt; d -&gt; m d) -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; m <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:gmapMo" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Number:Num:4" class="instance expander" onclick="toggleSection('i:id:Number:Num:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Num">Num</a> <a href="Data-Attoparsec-Text.html#t:Number">Number</a></span> <a href="src/Data-Attoparsec-Number.html#line-79" class="link">Source</a> <a href="#t:Number" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Number:Num:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-43-">(+)</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:-43-" class="selflink">#</a></p><p class="src"><a href="#v:-45-">(-)</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:-45-" class="selflink">#</a></p><p class="src"><a href="#v:-42-">(*)</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:-42-" class="selflink">#</a></p><p class="src"><a href="#v:negate">negate</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:negate" class="selflink">#</a></p><p class="src"><a href="#v:abs">abs</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:abs" class="selflink">#</a></p><p class="src"><a href="#v:signum">signum</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:signum" class="selflink">#</a></p><p class="src"><a href="#v:fromInteger">fromInteger</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integer">Integer</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:fromInteger" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Number:Ord:5" class="instance expander" onclick="toggleSection('i:id:Number:Ord:5')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ord">Ord</a> <a href="Data-Attoparsec-Text.html#t:Number">Number</a></span> <a href="src/Data-Attoparsec-Number.html#line-63" class="link">Source</a> <a href="#t:Number" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Number:Ord:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(&lt;)</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</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="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(&lt;=)</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</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="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(&gt;)</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</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="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(&gt;=)</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</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="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="#v:min" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Number:Real:6" class="instance expander" onclick="toggleSection('i:id:Number:Real:6')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Real">Real</a> <a href="Data-Attoparsec-Text.html#t:Number">Number</a></span> <a href="src/Data-Attoparsec-Number.html#line-104" class="link">Source</a> <a href="#t:Number" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Number:Real:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRational">toRational</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Rational">Rational</a> <a href="#v:toRational" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Number:RealFrac:7" class="instance expander" onclick="toggleSection('i:id:Number:RealFrac:7')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:RealFrac">RealFrac</a> <a href="Data-Attoparsec-Text.html#t:Number">Number</a></span> <a href="src/Data-Attoparsec-Number.html#line-121" class="link">Source</a> <a href="#t:Number" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Number:RealFrac:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:properFraction">properFraction</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integral">Integral</a> b =&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; (b, <a href="Data-Attoparsec-Text.html#t:Number">Number</a>) <a href="#v:properFraction" class="selflink">#</a></p><p class="src"><a href="#v:truncate">truncate</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integral">Integral</a> b =&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; b <a href="#v:truncate" class="selflink">#</a></p><p class="src"><a href="#v:round">round</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integral">Integral</a> b =&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; b <a href="#v:round" class="selflink">#</a></p><p class="src"><a href="#v:ceiling">ceiling</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integral">Integral</a> b =&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; b <a href="#v:ceiling" class="selflink">#</a></p><p class="src"><a href="#v:floor">floor</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integral">Integral</a> b =&gt; <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; b <a href="#v:floor" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Number:Show:8" class="instance expander" onclick="toggleSection('i:id:Number:Show:8')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> <a href="Data-Attoparsec-Text.html#t:Number">Number</a></span> <a href="src/Data-Attoparsec-Number.html#line-39" class="link">Source</a> <a href="#t:Number" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Number:Show:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</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="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</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="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Data-Attoparsec-Text.html#t:Number">Number</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Number:NFData:9" class="instance expander" onclick="toggleSection('i:id:Number:NFData:9')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/deepseq-1.4.2.0/Control-DeepSeq.html#t:NFData">NFData</a> <a href="Data-Attoparsec-Text.html#t:Number">Number</a></span> <a href="src/Data-Attoparsec-Number.html#line-43" class="link">Source</a> <a href="#t:Number" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Number:NFData:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:rnf">rnf</a> :: <a href="Data-Attoparsec-Text.html#t:Number">Number</a> -&gt; () <a href="#v:rnf" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:number" class="def">number</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="Data-Attoparsec-Text.html#t:Number">Number</a> <a href="src/Data-Attoparsec-Text.html#number" class="link">Source</a> <a href="#v:number" class="selflink">#</a></p><div class="doc"><div class="warning"><p>Deprecated: Use <code><a href="Data-Attoparsec-Text.html#v:scientific">scientific</a></code> instead.</p></div><p>Parse a number, attempting to preserve both speed and precision.</p><p>The syntax accepted by this parser is the same as for <code><a href="Data-Attoparsec-Text.html#v:double">double</a></code>.</p><p>This function does not accept string representations of &quot;NaN&quot; or
 &quot;Infinity&quot;.</p></div></div><div class="top"><p class="src"><a id="v:rational" class="def">rational</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Fractional">Fractional</a> a =&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a <a href="src/Data-Attoparsec-Text.html#rational" class="link">Source</a> <a href="#v:rational" class="selflink">#</a></p><div class="doc"><p>Parse a rational number.</p><p>The syntax accepted by this parser is the same as for <code><a href="Data-Attoparsec-Text.html#v:double">double</a></code>.</p><p><em>Note</em>: this parser is not safe for use with inputs from untrusted
 sources.  An input with a suitably large exponent such as
 <code>&quot;1e1000000000&quot;</code> will cause a huge <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integer">Integer</a></code> to be allocated,
 resulting in what is effectively a denial-of-service attack.</p><p>In most cases, it is better to use <code><a href="Data-Attoparsec-Text.html#v:double">double</a></code> or <code><a href="Data-Attoparsec-Text.html#v:scientific">scientific</a></code>
 instead.</p></div></div><div class="top"><p class="src"><a id="v:scientific" class="def">scientific</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-scientific-doc/html/Data-Scientific.html#t:Scientific">Scientific</a> <a href="src/Data-Attoparsec-Text.html#scientific" class="link">Source</a> <a href="#v:scientific" class="selflink">#</a></p><div class="doc"><p>Parse a scientific number.</p><p>The syntax accepted by this parser is the same as for <code><a href="Data-Attoparsec-Text.html#v:double">double</a></code>.</p></div></div><h1 id="g:16">Combinators</h1><div class="top"><p class="src"><a id="v:try" class="def">try</a> :: <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> i a -&gt; <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> i a <a href="src/Data-Attoparsec-Combinator.html#try" class="link">Source</a> <a href="#v:try" class="selflink">#</a></p><div class="doc"><p>Attempt a parse, and if it fails, rewind the input so that no
 input appears to have been consumed.</p><p>This combinator is provided for compatibility with Parsec.
 attoparsec parsers always backtrack on failure.</p></div></div><div class="top"><p class="src"><a id="v:-60--63--62-" class="def">(&lt;?&gt;)</a> <span class="fixity">infix 0</span><span class="rightedge"></span> <a href="src/Data-Attoparsec-Combinator.html#%3C%3F%3E" class="link">Source</a> <a href="#v:-60--63--62-" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> i a</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></td><td class="doc"><p>the name to use if parsing fails</p></td></tr><tr><td class="src">-&gt; <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> i a</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Name the parser, in case failure occurs.</p></div></div><div class="top"><p class="src"><a id="v:choice" class="def">choice</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; [f a] -&gt; f a <a href="src/Data-Attoparsec-Combinator.html#choice" class="link">Source</a> <a href="#v:choice" class="selflink">#</a></p><div class="doc"><p><code>choice ps</code> tries to apply the actions in the list <code>ps</code> in order,
 until one of them succeeds. Returns the value of the succeeding
 action.</p></div></div><div class="top"><p class="src"><a id="v:count" class="def">count</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; m a -&gt; m [a] <a href="src/Data-Attoparsec-Combinator.html#count" class="link">Source</a> <a href="#v:count" class="selflink">#</a></p><div class="doc"><p>Apply the given action repeatedly, returning every result.</p></div></div><div class="top"><p class="src"><a id="v:option" class="def">option</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; a -&gt; f a -&gt; f a <a href="src/Data-Attoparsec-Combinator.html#option" class="link">Source</a> <a href="#v:option" class="selflink">#</a></p><div class="doc"><p><code>option x p</code> tries to apply action <code>p</code>. If <code>p</code> fails without
 consuming input, it returns the value <code>x</code>, otherwise the value
 returned by <code>p</code>.</p><pre>priority  = option 0 (digitToInt &lt;$&gt; digit)</pre></div></div><div class="top"><p class="src"><a id="v:many-39-" class="def">many'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; m a -&gt; m [a] <a href="src/Data-Attoparsec-Combinator.html#many%27" class="link">Source</a> <a href="#v:many-39-" class="selflink">#</a></p><div class="doc"><p><code>many' p</code> applies the action <code>p</code> <em>zero</em> or more times. Returns a
 list of the returned values of <code>p</code>. The value returned by <code>p</code> is
 forced to WHNF.</p><pre> word  = many' letter</pre></div></div><div class="top"><p class="src"><a id="v:many1" class="def">many1</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f [a] <a href="src/Data-Attoparsec-Combinator.html#many1" class="link">Source</a> <a href="#v:many1" class="selflink">#</a></p><div class="doc"><p><code>many1 p</code> applies the action <code>p</code> <em>one</em> or more times. Returns a
 list of the returned values of <code>p</code>.</p><pre> word  = many1 letter</pre></div></div><div class="top"><p class="src"><a id="v:many1-39-" class="def">many1'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; m a -&gt; m [a] <a href="src/Data-Attoparsec-Combinator.html#many1%27" class="link">Source</a> <a href="#v:many1-39-" class="selflink">#</a></p><div class="doc"><p><code>many1' p</code> applies the action <code>p</code> <em>one</em> or more times. Returns a
 list of the returned values of <code>p</code>. The value returned by <code>p</code> is
 forced to WHNF.</p><pre> word  = many1' letter</pre></div></div><div class="top"><p class="src"><a id="v:manyTill" class="def">manyTill</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f b -&gt; f [a] <a href="src/Data-Attoparsec-Combinator.html#manyTill" class="link">Source</a> <a href="#v:manyTill" class="selflink">#</a></p><div class="doc"><p><code>manyTill p end</code> applies action <code>p</code> <em>zero</em> or more times until
 action <code>end</code> succeeds, and returns the list of values returned by
 <code>p</code>.  This can be used to scan comments:</p><pre> simpleComment   = string &quot;&lt;!--&quot; *&gt; manyTill anyChar (string &quot;--&gt;&quot;)</pre><p>(Note the overlapping parsers <code>anyChar</code> and <code>string &quot;--&gt;&quot;</code>.
 While this will work, it is not very efficient, as it will cause a
 lot of backtracking.)</p></div></div><div class="top"><p class="src"><a id="v:manyTill-39-" class="def">manyTill'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; m a -&gt; m b -&gt; m [a] <a href="src/Data-Attoparsec-Combinator.html#manyTill%27" class="link">Source</a> <a href="#v:manyTill-39-" class="selflink">#</a></p><div class="doc"><p><code>manyTill' p end</code> applies action <code>p</code> <em>zero</em> or more times until
 action <code>end</code> succeeds, and returns the list of values returned by
 <code>p</code>.  This can be used to scan comments:</p><pre> simpleComment   = string &quot;&lt;!--&quot; *&gt; manyTill' anyChar (string &quot;--&gt;&quot;)</pre><p>(Note the overlapping parsers <code>anyChar</code> and <code>string &quot;--&gt;&quot;</code>.
 While this will work, it is not very efficient, as it will cause a
 lot of backtracking.)</p><p>The value returned by <code>p</code> is forced to WHNF.</p></div></div><div class="top"><p class="src"><a id="v:sepBy" class="def">sepBy</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f s -&gt; f [a] <a href="src/Data-Attoparsec-Combinator.html#sepBy" class="link">Source</a> <a href="#v:sepBy" class="selflink">#</a></p><div class="doc"><p><code>sepBy p sep</code> applies <em>zero</em> or more occurrences of <code>p</code>, separated
 by <code>sep</code>. Returns a list of the values returned by <code>p</code>.</p><pre>commaSep p  = p `sepBy` (char ',')</pre></div></div><div class="top"><p class="src"><a id="v:sepBy-39-" class="def">sepBy'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; m a -&gt; m s -&gt; m [a] <a href="src/Data-Attoparsec-Combinator.html#sepBy%27" class="link">Source</a> <a href="#v:sepBy-39-" class="selflink">#</a></p><div class="doc"><p><code>sepBy' p sep</code> applies <em>zero</em> or more occurrences of <code>p</code>, separated
 by <code>sep</code>. Returns a list of the values returned by <code>p</code>. The value
 returned by <code>p</code> is forced to WHNF.</p><pre>commaSep p  = p `sepBy'` (char ',')</pre></div></div><div class="top"><p class="src"><a id="v:sepBy1" class="def">sepBy1</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f s -&gt; f [a] <a href="src/Data-Attoparsec-Combinator.html#sepBy1" class="link">Source</a> <a href="#v:sepBy1" class="selflink">#</a></p><div class="doc"><p><code>sepBy1 p sep</code> applies <em>one</em> or more occurrences of <code>p</code>, separated
 by <code>sep</code>. Returns a list of the values returned by <code>p</code>.</p><pre>commaSep p  = p `sepBy1` (char ',')</pre></div></div><div class="top"><p class="src"><a id="v:sepBy1-39-" class="def">sepBy1'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> m =&gt; m a -&gt; m s -&gt; m [a] <a href="src/Data-Attoparsec-Combinator.html#sepBy1%27" class="link">Source</a> <a href="#v:sepBy1-39-" class="selflink">#</a></p><div class="doc"><p><code>sepBy1' p sep</code> applies <em>one</em> or more occurrences of <code>p</code>, separated
 by <code>sep</code>. Returns a list of the values returned by <code>p</code>. The value
 returned by <code>p</code> is forced to WHNF.</p><pre>commaSep p  = p `sepBy1'` (char ',')</pre></div></div><div class="top"><p class="src"><a id="v:skipMany" class="def">skipMany</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f () <a href="src/Data-Attoparsec-Combinator.html#skipMany" class="link">Source</a> <a href="#v:skipMany" class="selflink">#</a></p><div class="doc"><p>Skip zero or more instances of an action.</p></div></div><div class="top"><p class="src"><a id="v:skipMany1" class="def">skipMany1</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f () <a href="src/Data-Attoparsec-Combinator.html#skipMany1" class="link">Source</a> <a href="#v:skipMany1" class="selflink">#</a></p><div class="doc"><p>Skip one or more instances of an action.</p></div></div><div class="top"><p class="src"><a id="v:eitherP" class="def">eitherP</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Alternative">Alternative</a> f =&gt; f a -&gt; f b -&gt; f (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> a b) <a href="src/Data-Attoparsec-Combinator.html#eitherP" class="link">Source</a> <a href="#v:eitherP" class="selflink">#</a></p><div class="doc"><p>Combine two alternatives.</p></div></div><div class="top"><p class="src"><a id="v:match" class="def">match</a> :: <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> a -&gt; <a href="Data-Attoparsec-Text.html#t:Parser">Parser</a> (<a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a>, a) <a href="src/Data-Attoparsec-Text-Internal.html#match" class="link">Source</a> <a href="#v:match" class="selflink">#</a></p><div class="doc"><p>Return both the result of a parse and the portion of the input
 that was consumed while it was being parsed.</p></div></div><h1 id="g:17">State observation and manipulation functions</h1><div class="top"><p class="src"><a id="v:endOfInput" class="def">endOfInput</a> :: <span class="keyword">forall</span> t. <a href="Data-Attoparsec-Internal-Types.html#t:Chunk">Chunk</a> t =&gt; <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> t () <a href="src/Data-Attoparsec-Internal.html#endOfInput" class="link">Source</a> <a href="#v:endOfInput" class="selflink">#</a></p><div class="doc"><p>Match only if all input has been consumed.</p></div></div><div class="top"><p class="src"><a id="v:atEnd" class="def">atEnd</a> :: <a href="Data-Attoparsec-Internal-Types.html#t:Chunk">Chunk</a> t =&gt; <a href="Data-Attoparsec-Internal-Types.html#t:Parser">Parser</a> t <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/Data-Attoparsec-Internal.html#atEnd" class="link">Source</a> <a href="#v:atEnd" class="selflink">#</a></p><div class="doc"><p>Return an indication of whether the end of input has been
 reached.</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>