Safe Haskell | None |
---|---|
Language | GHC2021 |
Binrep.Get.Error
Description
Common parser error definitions.
Synopsis
- type ParseError pos text = [ParseErrorSingle pos text]
- data ParseErrorSingle pos text = ParseErrorSingle {
- parseErrorSinglePos :: pos
- parseErrorSingleText :: [text]
- mapParseErrorSinglePos :: (pos1 -> pos2) -> ParseErrorSingle pos1 text -> ParseErrorSingle pos2 text
- parseError1 :: [text] -> pos -> ParseError pos text
- parseErrorTextGenericFieldBld :: String -> String -> Maybe String -> Natural -> [Builder]
- parseErrorTextGenericNoCstrMatchBld :: String -> [Builder]
- parseErrorTextGenericSumTagBld :: String -> [Builder]
Documentation
type ParseError pos text = [ParseErrorSingle pos text] Source #
Top-level parse error.
The final element is the concrete error. Prior elements should "contain" the error (i.e. be the larger part that the error occurred in).
Really should be non-empty-- but by using List, we can use the empty list for Fail. Bit of a cute cheat.
data ParseErrorSingle pos text Source #
A single indexed parse error.
Constructors
ParseErrorSingle | |
Fields
|
Instances
(Show pos, Show text) => Show (ParseErrorSingle pos text) Source # | |
Defined in Binrep.Get.Error Methods showsPrec :: Int -> ParseErrorSingle pos text -> ShowS # show :: ParseErrorSingle pos text -> String # showList :: [ParseErrorSingle pos text] -> ShowS # |
mapParseErrorSinglePos :: (pos1 -> pos2) -> ParseErrorSingle pos1 text -> ParseErrorSingle pos2 text Source #
Map over the pos
index type of a ParseErrorSingle
.
parseError1 :: [text] -> pos -> ParseError pos text Source #
Shorthand for one parse error.
parseErrorTextGenericFieldBld :: String -> String -> Maybe String -> Natural -> [Builder] Source #
Construct a parse error message for a generic field failure.
parseErrorTextGenericNoCstrMatchBld :: String -> [Builder] Source #
Construct a parse error message for a generic sum tag no-match.
parseErrorTextGenericSumTagBld :: String -> [Builder] Source #
Construct a parse error message for a generic sum tag parse error.