Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class TextBuildable a where
- newtype ShowTextBuildable a = ShowTextBuildable {
- unShowTextBuildable :: a
- class ExplainLabel l where
- explainLabel :: l -> Builder
- explainLabelText :: l -> Text
- data ErrorExplanation = ErrorExplanation {}
- class ExplainError e where
- explainError :: e -> ErrorExplanation
- type Explainable l s e = (PosStream s, ExplainLabel l, ExplainError e)
- data ParseErrorExplanation p = ParseErrorExplanation {
- peeSpan :: !(Span p)
- peeContext :: !(Seq Text)
- peeDetails :: !(Maybe Text)
- peeErrExp :: !ErrorExplanation
- explainParseError :: (TextBuildable (Token s), TextBuildable (Chunk s), Explainable l s e) => ParseError l s e -> ParseErrorExplanation (Pos s)
- buildParseErrorExplanation :: HasLinePos p => ParseErrorExplanation p -> Builder
- buildAllParseErrorExplanations :: (HasLinePos p, Foldable f) => f (ParseErrorExplanation p) -> Builder
Documentation
class TextBuildable a where Source #
Types that can be rendered into a textual error message (Effectively a fancy Show)
Instances
TextBuildable Char Source # | |
TextBuildable String Source # | |
TextBuildable Text Source # | |
TextBuildable Builder Source # | |
TextBuildable Atom Source # | |
TextBuildable a => TextBuildable [a] Source # | |
Defined in SimpleParser.Explain | |
TextBuildable a => TextBuildable (Seq a) Source # | |
Show a => TextBuildable (ShowTextBuildable a) Source # | |
Defined in SimpleParser.Explain buildText :: ShowTextBuildable a -> Builder Source # |
newtype ShowTextBuildable a Source #
Deriving-Via wrapper for TextBuildable
for types with Show
Instances
Show a => TextBuildable (ShowTextBuildable a) Source # | |
Defined in SimpleParser.Explain buildText :: ShowTextBuildable a -> Builder Source # |
class ExplainLabel l where Source #
explainLabel :: l -> Builder Source #
explainLabelText :: l -> Text Source #
Instances
data ErrorExplanation Source #
Instances
Eq ErrorExplanation Source # | |
Defined in SimpleParser.Explain (==) :: ErrorExplanation -> ErrorExplanation -> Bool # (/=) :: ErrorExplanation -> ErrorExplanation -> Bool # | |
Show ErrorExplanation Source # | |
Defined in SimpleParser.Explain showsPrec :: Int -> ErrorExplanation -> ShowS # show :: ErrorExplanation -> String # showList :: [ErrorExplanation] -> ShowS # |
class ExplainError e where Source #
explainError :: e -> ErrorExplanation Source #
Instances
ExplainError Void Source # | |
Defined in SimpleParser.Explain explainError :: Void -> ErrorExplanation Source # | |
(TextBuildable (Token s), TextBuildable (Chunk s)) => ExplainError (StreamError s) Source # | |
Defined in SimpleParser.Explain explainError :: StreamError s -> ErrorExplanation Source # | |
(TextBuildable (Token s), TextBuildable (Chunk s), ExplainError e) => ExplainError (CompoundError s e) Source # | |
Defined in SimpleParser.Explain explainError :: CompoundError s e -> ErrorExplanation Source # |
type Explainable l s e = (PosStream s, ExplainLabel l, ExplainError e) Source #
data ParseErrorExplanation p Source #
ParseErrorExplanation | |
|
Instances
Eq p => Eq (ParseErrorExplanation p) Source # | |
Defined in SimpleParser.Explain (==) :: ParseErrorExplanation p -> ParseErrorExplanation p -> Bool # (/=) :: ParseErrorExplanation p -> ParseErrorExplanation p -> Bool # | |
Show p => Show (ParseErrorExplanation p) Source # | |
Defined in SimpleParser.Explain showsPrec :: Int -> ParseErrorExplanation p -> ShowS # show :: ParseErrorExplanation p -> String # showList :: [ParseErrorExplanation p] -> ShowS # |
explainParseError :: (TextBuildable (Token s), TextBuildable (Chunk s), Explainable l s e) => ParseError l s e -> ParseErrorExplanation (Pos s) Source #
buildParseErrorExplanation :: HasLinePos p => ParseErrorExplanation p -> Builder Source #
buildAllParseErrorExplanations :: (HasLinePos p, Foldable f) => f (ParseErrorExplanation p) -> Builder Source #