Skip to content

Commit e57fe57

Browse files
committed
Update docs
1 parent da1ef24 commit e57fe57

File tree

4 files changed

+28
-23
lines changed

4 files changed

+28
-23
lines changed

bower.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"purescript-lists": "^1.0.0"
3131
},
3232
"devDependencies": {
33-
"purescript-math": "^2.0.0",
34-
"purescript-quickcheck": "^1.0.0"
33+
"purescript-math": "^2.0.0"
3534
}
3635
}

docs/Text/Parsing/StringParser.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,37 +36,39 @@ The type of parsing errors.
3636

3737
##### Instances
3838
``` purescript
39-
instance showParseError :: Show ParseError
40-
instance eqParseError :: Eq ParseError
39+
Show ParseError
40+
Eq ParseError
4141
```
4242

4343
#### `Parser`
4444

4545
``` purescript
4646
data Parser a
47-
= Parser (forall r. PosString -> (Pos -> ParseError -> r) -> (a -> PosString -> r) -> r)
47+
= Parser (PosString -> Either { pos :: Pos, error :: ParseError } { result :: a, suffix :: PosString })
4848
```
4949

5050
A parser is represented as a function which takes a pair of
5151
continuations for failure and success.
5252

5353
##### Instances
5454
``` purescript
55-
instance functorParser :: Functor Parser
56-
instance applyParser :: Apply Parser
57-
instance applicativeParser :: Applicative Parser
58-
instance altParser :: Alt Parser
59-
instance plusParser :: Plus Parser
60-
instance alternativeParser :: Alternative Parser
61-
instance bindParser :: Bind Parser
62-
instance monadParser :: Monad Parser
63-
instance monadPlusParser :: MonadPlus Parser
55+
Functor Parser
56+
Apply Parser
57+
Applicative Parser
58+
Alt Parser
59+
Plus Parser
60+
Alternative Parser
61+
Bind Parser
62+
Monad Parser
63+
MonadZero Parser
64+
MonadPlus Parser
65+
MonadRec Parser
6466
```
6567

6668
#### `unParser`
6769

6870
``` purescript
69-
unParser :: forall a r. Parser a -> PosString -> (Pos -> ParseError -> r) -> (a -> PosString -> r) -> r
71+
unParser :: forall a. Parser a -> PosString -> Either { pos :: Pos, error :: ParseError } { result :: a, suffix :: PosString }
7072
```
7173

7274
Run a parser by providing success and failure continuations.

docs/Text/Parsing/StringParser/Combinators.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,20 @@ many1 :: forall a. Parser a -> Parser (List a)
2626

2727
Match one or more times.
2828

29-
#### `(<?>)`
29+
#### `withError`
3030

3131
``` purescript
32-
(<?>) :: forall a. Parser a -> String -> Parser a
32+
withError :: forall a. Parser a -> String -> Parser a
3333
```
3434

35-
_left-associative / precedence -1_
36-
3735
Provide an error message in case of failure.
3836

37+
#### `(<?>)`
38+
39+
``` purescript
40+
infixl 3 withError as <?>
41+
```
42+
3943
#### `fix`
4044

4145
``` purescript
@@ -74,7 +78,7 @@ Attempt to parse a value.
7478
optionMaybe :: forall a. Parser a -> Parser (Maybe a)
7579
```
7680

77-
Attempt to parse a value, returning `Nothing` in case of failure.
81+
Attempt to parse a value, pureing `Nothing` in case of failure.
7882

7983
#### `sepBy`
8084

@@ -175,7 +179,7 @@ Parse one or more values separated by a right-associative operator.
175179
#### `choice`
176180

177181
``` purescript
178-
choice :: forall f a. (Foldable f) => f (Parser a) -> Parser a
182+
choice :: forall f a. Foldable f => f (Parser a) -> Parser a
179183
```
180184

181185
Parse using any of a collection of parsers.

docs/Text/Parsing/StringParser/String.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ Skip many whitespace characters.
6969
#### `oneOf`
7070

7171
``` purescript
72-
oneOf :: forall f. (Foldable f) => f Char -> Parser Char
72+
oneOf :: forall f. Foldable f => f Char -> Parser Char
7373
```
7474

7575
Match one of the characters in the foldable structure.
7676

7777
#### `noneOf`
7878

7979
``` purescript
80-
noneOf :: forall f. (Foldable f) => f Char -> Parser Char
80+
noneOf :: forall f. Foldable f => f Char -> Parser Char
8181
```
8282

8383
Match any character not in the foldable structure.

0 commit comments

Comments
 (0)