Skip to content

Commit e5cdcd3

Browse files
committed
Combinators docs
1 parent 97f8aac commit e5cdcd3

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/Parsing/Combinators.purs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
-- | ## Combinators
2-
-- |
3-
-- | A parser combinator is a function which takes some
1+
-- | A “parser combinator” is a function which takes some
42
-- | parsers as arguments and returns a new parser.
53
-- |
64
-- | ## Combinators in other packages
@@ -10,8 +8,10 @@
108
-- |
119
-- | If you use a combinator from some other package for parsing, keep in mind
1210
-- | 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.
1515
-- |
1616
-- | ### Data.Array
1717
-- |
@@ -24,8 +24,9 @@
2424
-- |
2525
-- | ### Data.List
2626
-- |
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__.
2930
-- |
3031
-- | ### Data.List.Lazy
3132
-- |
@@ -34,9 +35,7 @@
3435
-- |
3536
-- | ## Combinators in this package
3637
-- |
37-
-- | ### replicateA replicateM
38-
-- |
39-
-- | The __replicateA__ and __replicateM__ combinators are re-exported from
38+
-- | the __replicateA__ and __replicateM__ combinators are re-exported from
4039
-- | this module. `replicateA n p` or `replicateM n p`
4140
-- | will repeat parser `p` exactly `n` times. The `replicateA` combinator can
4241
-- | produce either an `Array` or a `List`.
@@ -52,10 +51,10 @@ module Parsing.Combinators
5251
, optional
5352
, many
5453
, many1
55-
, many1Till
56-
, many1Till_
5754
, manyTill
5855
, manyTill_
56+
, many1Till
57+
, many1Till_
5958
, skipMany
6059
, skipMany1
6160
, sepBy
@@ -397,7 +396,7 @@ many1Till_ p end = do
397396
-- | Parse many phrases until the terminator phrase matches.
398397
-- | Returns the list of phrases and the terminator phrase.
399398
-- |
400-
-- | ## Non-greedy repetition
399+
-- | #### Non-greedy repetition
401400
-- |
402401
-- | Use the __manyTill_ __ combinator
403402
-- | to do non-greedy repetition of a pattern `p`, like we would in Regex

0 commit comments

Comments
 (0)