data Message
This abstract data type represents parse error messages. There are four kinds of messages:
data Message = SysUnExpect String
| UnExpect String
| Expect String
| Message StringThe fine distinction between different kinds of parse errors allows the system to generate quite good error messages for the user. It also allows error messages that are formatted in different languages. Each kind of message is generated by different combinators:
A
SysUnExpectmessage is automatically generated by thesatisfycombinator. The argument is the unexpected input.
A
UnExpectmessage is generated by theunexpectedcombinator. The argument describes the unexpected item.
A
Expectmessage is generated by the<?>combinator. The argument describes the expected item.
A
Messagemessage is generated by thefailcombinator. The argument is some general parser message.