packages feed

megaparsec 9.4.0 → 9.4.1

raw patch · 4 files changed

+27/−5 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Text.Megaparsec.Debug: instance (Text.Megaparsec.Stream.VisualStream s, Text.Megaparsec.Error.ShowErrorComponent e, GHC.Base.Monad m) => Text.Megaparsec.Debug.MonadParsecDbg e s (Text.Megaparsec.Internal.ParsecT e s m)
- Text.Megaparsec.Internal: instance (GHC.Classes.Ord e, Text.Megaparsec.Stream.Stream s, GHC.Base.Monad m) => Text.Megaparsec.Class.MonadParsec e s (Text.Megaparsec.Internal.ParsecT e s m)
- Text.Megaparsec.Internal: instance (a GHC.Types.~ Text.Megaparsec.Stream.Tokens s, Data.String.IsString a, GHC.Classes.Eq a, Text.Megaparsec.Stream.Stream s, GHC.Classes.Ord e, GHC.Base.Monad m) => Data.String.IsString (Text.Megaparsec.Internal.ParsecT e s m a)
+ Text.Megaparsec.Debug: instance (Text.Megaparsec.Stream.VisualStream s, Text.Megaparsec.Error.ShowErrorComponent e) => Text.Megaparsec.Debug.MonadParsecDbg e s (Text.Megaparsec.Internal.ParsecT e s m)
+ Text.Megaparsec.Internal: instance (GHC.Classes.Ord e, Text.Megaparsec.Stream.Stream s) => Text.Megaparsec.Class.MonadParsec e s (Text.Megaparsec.Internal.ParsecT e s m)
+ Text.Megaparsec.Internal: instance (a GHC.Types.~ Text.Megaparsec.Stream.Tokens s, Data.String.IsString a, GHC.Classes.Eq a, Text.Megaparsec.Stream.Stream s, GHC.Classes.Ord e) => Data.String.IsString (Text.Megaparsec.Internal.ParsecT e s m a)

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ *Megaparsec follows [SemVer](https://semver.org/).* +## Megaparsec 9.4.1++* Removed `Monad m` constraints in several places where they were introduced+  in 9.4.0. [Issue 532](https://github.com/mrkkrp/megaparsec/issues/532).+ ## Megaparsec 9.4.0  * `dbg` now prints hints among other debug information. [PR
Text/Megaparsec/Debug.hs view
@@ -216,7 +216,7 @@   show (ShowComment lbl (a, c)) = show a ++ " (" ++ lbl ++ ": " ++ show c ++ ")"  instance-  (VisualStream s, ShowErrorComponent e, Monad m) =>+  (VisualStream s, ShowErrorComponent e) =>   MonadParsecDbg e s (ParsecT e s m)   where   dbg lbl p = ParsecT $ \s cok cerr eok eerr ->
Text/Megaparsec/Internal.hs view
@@ -151,7 +151,7 @@  -- | @since 6.3.0 instance-  (a ~ Tokens s, IsString a, Eq a, Stream s, Ord e, Monad m) =>+  (a ~ Tokens s, IsString a, Eq a, Stream s, Ord e) =>   IsString (ParsecT e s m a)   where   fromString s = tokens (==) (fromString s)@@ -285,6 +285,23 @@         Error e -> eerr e s' {-# INLINE mkParsecT #-} +pmkParsec ::+  (Stream s) =>+  (State s e -> Reply e s a) ->+  ParsecT e s m a+pmkParsec k = ParsecT $ \s cok cerr eok eerr ->+  let (Reply s' consumption result) = k s+   in case consumption of+        Consumed ->+          case result of+            OK hs x -> cok x s' hs+            Error e -> cerr e s'+        NotConsumed ->+          case result of+            OK hs x -> eok x s' hs+            Error e -> eerr e s'+{-# INLINE pmkParsec #-}+ -- | 'mzero' is a parser that __fails__ without consuming input. -- -- __Note__: strictly speaking, this instance is unlawful. The right@@ -341,7 +358,7 @@   lift amb = ParsecT $ \s _ _ eok _ ->     amb >>= \a -> eok a s mempty -instance (Ord e, Stream s, Monad m) => MonadParsec e s (ParsecT e s m) where+instance (Ord e, Stream s) => MonadParsec e s (ParsecT e s m) where   parseError = pParseError   label = pLabel   try = pTry@@ -357,7 +374,7 @@   takeP = pTakeP   getParserState = pGetParserState   updateParserState = pUpdateParserState-  mkParsec f = mkParsecT (pure . f)+  mkParsec = pmkParsec  pParseError ::   ParseError s e ->
megaparsec.cabal view
@@ -1,6 +1,6 @@ cabal-version:   2.4 name:            megaparsec-version:         9.4.0+version:         9.4.1 license:         BSD-2-Clause license-file:    LICENSE.md maintainer:      Mark Karpov <markkarpov92@gmail.com>