Skip to content

Commit

Permalink
Merge pull request #134 from jmang00/patch-2
Browse files Browse the repository at this point in the history
Fix typo (Function -> Functor)
  • Loading branch information
tgdwyer authored Oct 4, 2024
2 parents 1c0c293 + 8e03388 commit 6ff0015
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _chapters/parsercombinators.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Then the `Parser` type has one field `parse` which is a function of type `Input

Well come back to the `ParseError` type - which will be returned in the case of unexpected input, but we can see that a successful Parse is going to produce a `Result` which has two fieldsmore `Input` (the part of the input remaining after we took a bit off and parsed it), and an `a`, a type parameter that we may specify for concrete `Parser` instances.

The `Parser` and the `ParseResult` types are pretty abstract. They say nothing about what precise `Input` string we are going to parse, or what type `a` we are going to return in the result. This is the strength of the parser, allowing us to build up sophisticated parsers for different input grammars through composition using [instances of Function, Applicative and Monad](/parsercombinators/#instances), and the `ParseResult` parameter `a` allows us to produce whatever we want from the parsers we create.
The `Parser` and the `ParseResult` types are pretty abstract. They say nothing about what precise `Input` string we are going to parse, or what type `a` we are going to return in the result. This is the strength of the parser, allowing us to build up sophisticated parsers for different input grammars through composition using [instances of Functor, Applicative and Monad](/parsercombinators/#instances), and the `ParseResult` parameter `a` allows us to produce whatever we want from the parsers we create.

## Error Handling

Expand Down

0 comments on commit 6ff0015

Please sign in to comment.