Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Reporter a
- data Report = Report {
- _reportFile :: !FilePath
- _reportLine :: !Int
- _reportCol :: !Int
- _reportErrors :: [ErrorContext]
- runReporter :: Reporter a -> FilePath -> ByteString -> Either Report a
- runReporterWithOptions :: ReportOptions -> Reporter a -> FilePath -> ByteString -> Either Report a
- type ErrorContext = ([Error], [String])
- showReport :: Report -> String
- showErrors :: [ErrorContext] -> String
- data ReportOptions = ReportOptions {}
- defaultReportOptions :: ReportOptions
- data Tracer a
- runTracer :: Tracer a -> FilePath -> ByteString -> Either Report a
Documentation
Parser which is optimized for good error reports.
Performance is secondary, since the Reporter
is used
as a fallback to the Acceptor
.
Instances
Report | |
|
Instances
Eq Report Source # | |
Show Report Source # | |
Generic Report Source # | |
type Rep Report Source # | |
Defined in Text.PariPari.Reporter type Rep Report = D1 (MetaData "Report" "Text.PariPari.Reporter" "paripari-0.1.0.0-3bHffQaMVFHBdNIVKeDa1t" False) (C1 (MetaCons "Report" PrefixI True) ((S1 (MetaSel (Just "_reportFile") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 FilePath) :*: S1 (MetaSel (Just "_reportLine") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)) :*: (S1 (MetaSel (Just "_reportCol") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "_reportErrors") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ErrorContext])))) |
runReporter :: Reporter a -> FilePath -> ByteString -> Either Report a Source #
Run Reporter
on the given ByteString
, returning either
an error Report
or, if successful, the result.
runReporterWithOptions :: ReportOptions -> Reporter a -> FilePath -> ByteString -> Either Report a Source #
Run Reporter
with additional ReportOptions
.
type ErrorContext = ([Error], [String]) Source #
showErrors :: [ErrorContext] -> String Source #
Pretty string representation of '[ErrorContext]'.
data ReportOptions Source #
Instances
Parser which prints trace messages, when backtracking occurs.
Instances
Monad Tracer Source # | |
Functor Tracer Source # | |
MonadFail Tracer Source # | |
Defined in Text.PariPari.Reporter | |
Applicative Tracer Source # | |
Alternative Tracer Source # | |
MonadPlus Tracer Source # | |
MonadParser Tracer Source # | |
Defined in Text.PariPari.Reporter getFile :: Tracer FilePath Source # getRefPos :: Tracer Pos Source # withRefPos :: Tracer a -> Tracer a Source # notFollowedBy :: Show a => Tracer a -> Tracer () Source # lookAhead :: Tracer a -> Tracer a Source # failWith :: Error -> Tracer a Source # label :: String -> Tracer a -> Tracer a Source # hidden :: Tracer a -> Tracer a Source # commit :: Tracer a -> Tracer a Source # byte :: Word8 -> Tracer Word8 Source # char :: Char -> Tracer Char Source # satisfy :: (Char -> Bool) -> Tracer Char Source # byteSatisfy :: (Word8 -> Bool) -> Tracer Word8 Source # bytes :: ByteString -> Tracer ByteString Source # | |
Semigroup a => Semigroup (Tracer a) Source # | |
Monoid a => Monoid (Tracer a) Source # | |