binrep
Safe HaskellNone
LanguageGHC2021

Binrep.Get.Error

Description

Common parser error definitions.

Synopsis

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

Instances details
(Show pos, Show text) => Show (ParseErrorSingle pos text) Source # 
Instance details

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.