packages feed

trifecta 1.1 → 1.2

raw patch · 3 files changed

+11/−4 lines, 3 filesdep ~ansi-wl-pprintdep ~base

Dependency ranges changed: ansi-wl-pprint, base

Files

src/Text/Trifecta/Parser.hs view
@@ -97,9 +97,9 @@   {-# INLINE (<>) #-}  instance Monoid (Parser a) where-  mappend = (<|>)+  mappend = liftA2 mappend   {-# INLINE mappend #-}-  mempty = empty+  mempty = pure mempty   {-# INLINE mempty #-}  instance Monad Parser where@@ -148,6 +148,10 @@   {-# INLINE unexpected #-}   eof = notFollowedBy anyChar <?> "end of input"   {-# INLINE eof #-}++instance Errable Parser where+  raiseErr e = Parser $ \ _ ee _ _ _ _ -> ee e+  {-# INLINE raiseErr #-}  instance LookAheadParsing Parser where   lookAhead (Parser m) = Parser $ \eo ee _ -> m eo ee (\a _ _ _ -> eo a mempty)
src/Text/Trifecta/Result.hs view
@@ -29,7 +29,7 @@   , _Success   , _Failure   -- * Parsing Errors-  , Err(..), HasErr(..)+  , Err(..), HasErr(..), Errable(..)   , explain   , failed   ) where@@ -88,6 +88,9 @@     report txt = vsep $ [pretty (delta r) <> Pretty.char ':' <+> red (text "error") <> Pretty.char ':' <+> nest 4 txt]              <|> pretty r <$ guard (not (nullRendering r))              <|> as++class Errable m where+  raiseErr :: Err -> m a  -- | The result of parsing. Either we succeeded or something went wrong. data Result a
trifecta.cabal view
@@ -1,6 +1,6 @@ name:          trifecta category:      Text, Parsing, Diagnostics, Pretty Printer, Logging-version:       1.1+version:       1.2 license:       BSD3 cabal-version: >= 1.10 license-file:  LICENSE