1
- -- | ## Combinators
2
- -- |
3
- -- | A parser combinator is a function which takes some
1
+ -- | A “parser combinator” is a function which takes some
4
2
-- | parsers as arguments and returns a new parser.
5
3
-- |
6
4
-- | ## Combinators in other packages
10
8
-- |
11
9
-- | If you use a combinator from some other package for parsing, keep in mind
12
10
-- | this surprising truth about the __parsing__ package:
13
- -- | All combinators used with this package will be stack-safe,
14
- -- | but usually the `MonadRec` combinators will run faster.
11
+ -- | All other combinators used with this package will be stack-safe,
12
+ -- | but usually the combinators with a `MonadRec` constraint will run faster.
13
+ -- | So you should prefer `MonadRec` versions of combinators, but for reasons
14
+ -- | of speed, not stack-safety.
15
15
-- |
16
16
-- | ### Data.Array
17
17
-- |
24
24
-- |
25
25
-- | ### Data.List
26
26
-- |
27
- -- | For good parsing speed we recommend using the `many` and `many1` combinators in this package
28
- -- | to parse a `List`.
27
+ -- | The `many` and `many1` combinators in this package
28
+ -- | are redeclarations of
29
+ -- | the `manyRec` and `someRec` combinators in __Data.List__.
29
30
-- |
30
31
-- | ### Data.List.Lazy
31
32
-- |
34
35
-- |
35
36
-- | ## Combinators in this package
36
37
-- |
37
- -- | ### replicateA replicateM
38
- -- |
39
- -- | The __replicateA__ and __replicateM__ combinators are re-exported from
38
+ -- | the __replicateA__ and __replicateM__ combinators are re-exported from
40
39
-- | this module. `replicateA n p` or `replicateM n p`
41
40
-- | will repeat parser `p` exactly `n` times. The `replicateA` combinator can
42
41
-- | produce either an `Array` or a `List`.
@@ -52,10 +51,10 @@ module Parsing.Combinators
52
51
, optional
53
52
, many
54
53
, many1
55
- , many1Till
56
- , many1Till_
57
54
, manyTill
58
55
, manyTill_
56
+ , many1Till
57
+ , many1Till_
59
58
, skipMany
60
59
, skipMany1
61
60
, sepBy
@@ -397,7 +396,7 @@ many1Till_ p end = do
397
396
-- | Parse many phrases until the terminator phrase matches.
398
397
-- | Returns the list of phrases and the terminator phrase.
399
398
-- |
400
- -- | ## Non-greedy repetition
399
+ -- | #### Non-greedy repetition
401
400
-- |
402
401
-- | Use the __manyTill_ __ combinator
403
402
-- | to do non-greedy repetition of a pattern `p`, like we would in Regex
0 commit comments