Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-megaparsec for openSUSE:Factory checked in at 2021-08-25 20:56:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-megaparsec (Old) and /work/SRC/openSUSE:Factory/.ghc-megaparsec.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-megaparsec" Wed Aug 25 20:56:57 2021 rev:13 rq:912608 version:9.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-megaparsec/ghc-megaparsec.changes 2020-12-22 11:42:33.577673998 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-megaparsec.new.1899/ghc-megaparsec.changes 2021-08-25 20:57:52.069188004 +0200 @@ -1,0 +2,17 @@ +Sun Aug 8 22:06:07 UTC 2021 - [email protected] + +- Update megaparsec to version 9.1.0 revision 1. + Upstream has revised the Cabal build instructions on Hackage. + +------------------------------------------------------------------- +Thu Jul 15 16:16:11 UTC 2021 - [email protected] + +- Update megaparsec to version 9.1.0. + ## Megaparsec 9.1.0 + + * Added `dbg'` in `Text.Megaparsec.Debug` for debugging parsers that have + unshowable return values. + + * Documentation improvements. + +------------------------------------------------------------------- Old: ---- megaparsec-9.0.1.tar.gz New: ---- megaparsec-9.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-megaparsec.spec ++++++ --- /var/tmp/diff_new_pack.jHtmMv/_old 2021-08-25 20:57:54.313185058 +0200 +++ /var/tmp/diff_new_pack.jHtmMv/_new 2021-08-25 20:57:54.317185053 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-megaparsec # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %global pkg_name megaparsec Name: ghc-%{pkg_name} -Version: 9.0.1 +Version: 9.1.0 Release: 0 Summary: Monadic parser combinators License: BSD-2-Clause ++++++ megaparsec-9.0.1.tar.gz -> megaparsec-9.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/CHANGELOG.md new/megaparsec-9.1.0/CHANGELOG.md --- old/megaparsec-9.0.1/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,10 @@ +## Megaparsec 9.1.0 + +* Added `dbg'` in `Text.Megaparsec.Debug` for debugging parsers that have + unshowable return values. + +* Documentation improvements. + ## Megaparsec 9.0.1 * Added [Safe diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/README.md new/megaparsec-9.1.0/README.md --- old/megaparsec-9.0.1/README.md 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/README.md 2001-09-09 03:46:40.000000000 +0200 @@ -88,16 +88,16 @@ ### Error messages * Megaparsec has typed error messages and the ability to signal custom parse - errors that better suit user's domain of interest. + errors that better suit the user's domain of interest. -* Since version 8, location of parse errors can independent of current +* Since version 8, the location of parse errors can independent of current offset in the input stream. It is useful when you want a parse error to point to a particular position after performing some checks. -* Instead of single parse error Megaparsec produces so-called +* Instead of a single parse error Megaparsec produces so-called `ParseErrorBundle` data type that helps to manage multi-error messages and - pretty-print them easily and efficiently. Since version 8, reporting - multiple parse errors at once has become much easier. + pretty-print them. Since version 8, reporting multiple parse errors at + once has become easier. ### External lexers @@ -139,8 +139,7 @@ You can find the most complete Megaparsec tutorial [here][the-tutorial]. It should provide sufficient guidance to help you start with your parsing -tasks. The site also has instructions and tips for Parsec users who decide -to migrate to Megaparsec. +tasks. ## Performance @@ -185,12 +184,12 @@ matters more than quality of error messages. * *Megaparsec* is good for parsing of source code or other human-readable - texts. It has better error messages and it's implemented as monad + texts. It has better error messages and it's implemented as a monad transformer. -So, if you work with something human-readable where size of input data is -moderate, just go with Megaparsec, otherwise Attoparsec may be a better -choice. +So, if you work with something human-readable where the size of input data +is moderate, it makes sense to go with Megaparsec, otherwise Attoparsec may +be a better choice. ### Megaparsec vs Parsec @@ -209,18 +208,18 @@ * Better support for Unicode parsing in [`Text.Megaparsec.Char`][tm-char]. * Megaparsec has more powerful combinators and can parse languages where - indentation matters out-of-the-box. + indentation matters. * Better documentation. * Megaparsec can recover from parse errors ???on the fly??? and continue parsing. -* Megaparsec allows us to conditionally process parse errors *inside your - parser* before parsing is finished. In particular, it's possible to define - regions in which parse errors, should they happen, will get a ???context - tag???, e.g. we could build a context stack like ???in function definition - foo???, ???in expression x???, etc. +* Megaparsec allows us to conditionally process parse errors inside a + running parser. In particular, it's possible to define regions in which + parse errors, should they happen, will get a ???context tag???, e.g. we could + build a context stack like ???in function definition foo???, ???in expression + x???, etc. * Megaparsec is faster and supports efficient operations `tokens`, `takeWhileP`, `takeWhile1P`, `takeP`, like Attoparsec. @@ -236,13 +235,12 @@ use: * Complicated, doesn't have any tutorials available, and documentation - doesn't help at all. + doesn't help much. * Trifecta can parse `String` and `ByteString` natively, but not `Text`. * Depends on `lens`, which is a very heavy dependency. If you're not into - `lens` and would like to keep your code ???vanilla???, you may not like the - API. + `lens`, you may not like the API. [Idris][idris] has switched from Trifecta to Megaparsec which allowed it to [have better error messages and fewer dependencies][idris-testimony]. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/Text/Megaparsec/Byte/Lexer.hs new/megaparsec-9.1.0/Text/Megaparsec/Byte/Lexer.hs --- old/megaparsec-9.0.1/Text/Megaparsec/Byte/Lexer.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/Text/Megaparsec/Byte/Lexer.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,5 @@ +{-# LANGUAGE Safe #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE Trustworthy #-} {-# LANGUAGE TypeFamilies #-} -- | @@ -52,7 +52,7 @@ ---------------------------------------------------------------------------- -- White space --- | Given comment prefix this function returns a parser that skips line +-- | Given a comment prefix this function returns a parser that skips line -- comments. Note that it stops just before the newline character but -- doesn't consume the newline. Newline is either supposed to be consumed by -- 'space' parser or picked up manually. @@ -101,8 +101,8 @@ ---------------------------------------------------------------------------- -- Numbers --- | Parse an integer in decimal representation according to the format of --- integer literals described in the Haskell report. +-- | Parse an integer in the decimal representation according to the format +-- of integer literals described in the Haskell report. -- -- If you need to parse signed integers, see the 'signed' combinator. decimal :: @@ -123,8 +123,8 @@ step a w = a * 10 + fromIntegral (w - 48) {-# INLINE decimal_ #-} --- | Parse an integer in binary representation. Binary number is expected to --- be a non-empty sequence of zeroes ???0??? and ones ???1???. +-- | Parse an integer in the binary representation. The binary number is +-- expected to be a non-empty sequence of zeroes ???0??? and ones ???1???. -- -- You could of course parse some prefix before the actual number: -- @@ -145,7 +145,7 @@ isBinDigit w = w == 48 || w == 49 {-# INLINEABLE binary #-} --- | Parse an integer in octal representation. Representation of octal +-- | Parse an integer in the octal representation. The format of the octal -- number is expected to be according to the Haskell report except for the -- fact that this parser doesn't parse ???0o??? or ???0O??? prefix. It is a -- responsibility of the programmer to parse correct prefix before parsing @@ -168,7 +168,7 @@ isOctDigit w = w - 48 < 8 {-# INLINEABLE octal #-} --- | Parse an integer in hexadecimal representation. Representation of +-- | Parse an integer in the hexadecimal representation. The format of the -- hexadecimal number is expected to be according to the Haskell report -- except for the fact that this parser doesn't parse ???0x??? or ???0X??? prefix. -- It is a responsibility of the programmer to parse correct prefix before @@ -291,7 +291,7 @@ ---------------------------------------------------------------------------- -- Helpers --- | A fast predicate to check if given 'Word8' is a digit in ASCII. +-- | A fast predicate to check if the given 'Word8' is a digit in ASCII. isDigit :: Word8 -> Bool isDigit w = w - 48 < 10 {-# INLINE isDigit #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/Text/Megaparsec/Char/Lexer.hs new/megaparsec-9.1.0/Text/Megaparsec/Char/Lexer.hs --- old/megaparsec-9.0.1/Text/Megaparsec/Char/Lexer.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/Text/Megaparsec/Char/Lexer.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,7 +1,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiWayIf #-} +{-# LANGUAGE Safe #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE Trustworthy #-} {-# LANGUAGE TypeFamilies #-} -- | @@ -82,7 +82,7 @@ ---------------------------------------------------------------------------- -- White space --- | Given comment prefix this function returns a parser that skips line +-- | Given a comment prefix this function returns a parser that skips line -- comments. Note that it stops just before the newline character but -- doesn't consume the newline. Newline is either supposed to be consumed by -- 'space' parser or picked up manually. @@ -223,10 +223,10 @@ -- be present IndentSome (Maybe Pos) ([b] -> m a) (m b) --- | Parse a ???reference??? token and a number of other tokens that have --- greater (but the same) level of indentation than that of ???reference??? --- token. Reference token can influence parsing, see 'IndentOpt' for more --- information. +-- | Parse a ???reference??? token and a number of other tokens that have a +-- greater (but the same for all of them) level of indentation than that of +-- the ???reference??? token. The reference token can influence parsing, see +-- 'IndentOpt' for more information. -- -- Tokens /must not/ consume newlines after them. On the other hand, the -- first argument of this function /must/ consume newlines among other white @@ -352,8 +352,8 @@ ---------------------------------------------------------------------------- -- Numbers --- | Parse an integer in decimal representation according to the format of --- integer literals described in the Haskell report. +-- | Parse an integer in the decimal representation according to the format +-- of integer literals described in the Haskell report. -- -- If you need to parse signed integers, see the 'signed' combinator. -- @@ -374,8 +374,8 @@ step a c = a * 10 + fromIntegral (Char.digitToInt c) {-# INLINE decimal_ #-} --- | Parse an integer in binary representation. Binary number is expected to --- be a non-empty sequence of zeroes ???0??? and ones ???1???. +-- | Parse an integer in binary representation. The binary number is +-- expected to be a non-empty sequence of zeroes ???0??? and ones ???1???. -- -- You could of course parse some prefix before the actual number: -- @@ -396,7 +396,7 @@ isBinDigit x = x == '0' || x == '1' {-# INLINEABLE binary #-} --- | Parse an integer in octal representation. Representation of octal +-- | Parse an integer in the octal representation. The format of the octal -- number is expected to be according to the Haskell report except for the -- fact that this parser doesn't parse ???0o??? or ???0O??? prefix. It is a -- responsibility of the programmer to parse correct prefix before parsing @@ -421,7 +421,7 @@ step a c = a * 8 + fromIntegral (Char.digitToInt c) {-# INLINEABLE octal #-} --- | Parse an integer in hexadecimal representation. Representation of +-- | Parse an integer in the hexadecimal representation. The format of the -- hexadecimal number is expected to be according to the Haskell report -- except for the fact that this parser doesn't parse ???0x??? or ???0X??? prefix. -- It is a responsibility of the programmer to parse correct prefix before @@ -519,10 +519,10 @@ (+ e') <$> signed (return ()) decimal_ {-# INLINE exponent_ #-} --- | @'signed' space p@ parser parses an optional sign character (???+??? or --- ???-???), then if there is a sign it consumes optional white space (using --- @space@ parser), then it runs parser @p@ which should return a number. --- Sign of the number is changed according to the previously parsed sign +-- | @'signed' space p@ parses an optional sign character (???+??? or ???-???), then +-- if there is a sign it consumes optional white space (using the @space@ +-- parser), then it runs the parser @p@ which should return a number. Sign +-- of the number is changed according to the previously parsed sign -- character. -- -- For example, to parse signed integer you can write: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/Text/Megaparsec/Class.hs new/megaparsec-9.1.0/Text/Megaparsec/Class.hs --- old/megaparsec-9.0.1/Text/Megaparsec/Class.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/Text/Megaparsec/Class.hs 2001-09-09 03:46:40.000000000 +0200 @@ -48,7 +48,7 @@ -- 'takeWhileP', 'takeWhile1P', and 'takeP'. class (Stream s, MonadPlus m) => MonadParsec e s m | m -> e s where -- | Stop parsing and report the 'ParseError'. This is the only way to - -- control position of the error without manipulating parser state + -- control position of the error without manipulating the parser state -- manually. -- -- @since 8.0.0 @@ -66,7 +66,7 @@ hidden :: m a -> m a hidden = label "" - -- | The parser @'try' p@ behaves like parser @p@, except that it + -- | The parser @'try' p@ behaves like the parser @p@, except that it -- backtracks the parser state when @p@ fails (either consuming input or -- not). -- @@ -118,13 +118,13 @@ -- can be used to implement the ???longest match??? rule. notFollowedBy :: m a -> m () - -- | @'withRecovery' r p@ allows continue parsing even if parser @p@ - -- fails. In this case @r@ is called with the actual 'ParseError' as its - -- argument. Typical usage is to return a value signifying failure to + -- | @'withRecovery' r p@ allows us to continue parsing even if the parser + -- @p@ fails. In this case @r@ is called with the actual 'ParseError' as + -- its argument. Typical usage is to return a value signifying failure to -- parse this particular object and to consume some part of the input up -- to the point where the next object starts. -- - -- Note that if @r@ fails, original error message is reported as if + -- Note that if @r@ fails, the original error message is reported as if -- without 'withRecovery'. In no way recovering parser @r@ can influence -- error messages. -- @@ -137,12 +137,12 @@ -- | Parser that can recover from failures m a - -- | @'observing' p@ allows to ???observe??? failure of the @p@ parser, should - -- it happen, without actually ending parsing but instead getting the - -- 'ParseError' in 'Left'. On success parsed value is returned in 'Right' - -- as usual. Note that this primitive just allows you to observe parse - -- errors as they happen, it does not backtrack or change how the @p@ - -- parser works in any way. + -- | @'observing' p@ allows us to ???observe??? failure of the @p@ parser, + -- should it happen, without actually ending parsing but instead getting + -- the 'ParseError' in 'Left'. On success parsed value is returned in + -- 'Right' as usual. Note that this primitive just allows you to observe + -- parse errors as they happen, it does not backtrack or change how the + -- @p@ parser works in any way. -- -- @since 5.1.0 observing :: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/Text/Megaparsec/Common.hs new/megaparsec-9.1.0/Text/Megaparsec/Common.hs --- old/megaparsec-9.0.1/Text/Megaparsec/Common.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/Text/Megaparsec/Common.hs 2001-09-09 03:46:40.000000000 +0200 @@ -30,7 +30,7 @@ {-# INLINE string #-} -- | The same as 'string', but case-insensitive. On success returns string --- cased as actually parsed input. +-- cased as the parsed input. -- -- >>> parseTest (string' "foobar") "foObAr" -- "foObAr" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/Text/Megaparsec/Debug.hs new/megaparsec-9.1.0/Text/Megaparsec/Debug.hs --- old/megaparsec-9.0.1/Text/Megaparsec/Debug.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/Text/Megaparsec/Debug.hs 2001-09-09 03:46:40.000000000 +0200 @@ -16,6 +16,7 @@ -- @since 7.0.0 module Text.Megaparsec.Debug ( dbg, + dbg', ) where @@ -28,8 +29,8 @@ import Text.Megaparsec.Stream -- | @'dbg' label p@ parser works exactly like @p@, but when it's evaluated --- it also prints information useful for debugging. The @label@ is only used --- to refer to this parser in the debugging output. This combinator uses the +-- it prints information useful for debugging. The @label@ is only used to +-- refer to this parser in the debugging output. This combinator uses the -- 'trace' function from "Debug.Trace" under the hood. -- -- Typical usage is to wrap every sub-parser in misbehaving parser with @@ -88,6 +89,29 @@ ++ l (DbgEERR (streamTake (streamDelta s s') (stateInput s)) err) in unParser p s cok' cerr' eok' eerr' +-- | Just like 'dbg', but doesn't require the return value of the parser to +-- be 'Show'-able. +-- +-- @since 9.1.0 +dbg' :: + forall e s m a. + ( VisualStream s, + ShowErrorComponent e + ) => + -- | Debugging label + String -> + -- | Parser to debug + ParsecT e s m a -> + -- | Parser that prints debugging messages + ParsecT e s m a +dbg' lbl p = unBlind <$> dbg lbl (Blind <$> p) + +-- | A wrapper type with a dummy 'Show' instance. +newtype Blind x = Blind {unBlind :: x} + +instance Show (Blind x) where + show _ = "NOT SHOWN" + -- | A single piece of info to be rendered with 'dbgLog'. data DbgItem s e a = DbgIn [Token s] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/Text/Megaparsec/Error/Builder.hs new/megaparsec-9.1.0/Text/Megaparsec/Error/Builder.hs --- old/megaparsec-9.0.1/Text/Megaparsec/Error/Builder.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/Text/Megaparsec/Error/Builder.hs 2001-09-09 03:46:40.000000000 +0200 @@ -96,9 +96,9 @@ ---------------------------------------------------------------------------- -- Top-level helpers --- | Assemble a 'ParseError' from offset and @'ET' t@ value. @'ET' t@ is a --- monoid and can be assembled by combining primitives provided by this --- module, see below. +-- | Assemble a 'ParseError' from the offset and the @'ET' t@ value. @'ET' +-- t@ is a monoid and can be assembled by combining primitives provided by +-- this module, see below. err :: -- | 'ParseError' offset Int -> @@ -168,8 +168,8 @@ ---------------------------------------------------------------------------- -- Helpers --- | Construct appropriate 'ErrorItem' representation for given token --- stream. Empty string produces 'EndOfInput'. +-- | Construct the appropriate 'ErrorItem' representation for the given +-- token stream. The empty string produces 'EndOfInput'. canonicalizeTokens :: Stream s => Proxy s -> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/Text/Megaparsec/Error.hs new/megaparsec-9.1.0/Text/Megaparsec/Error.hs --- old/megaparsec-9.0.1/Text/Megaparsec/Error.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/Text/Megaparsec/Error.hs 2001-09-09 03:46:40.000000000 +0200 @@ -20,8 +20,8 @@ -- Stability : experimental -- Portability : portable -- --- Parse errors. The current version of Megaparsec supports well-typed --- errors instead of 'String'-based ones. This gives a lot of flexibility in +-- Parse errors. The current version of Megaparsec supports typed errors +-- instead of 'String'-based ones. This gives a lot of flexibility in -- describing what exactly went wrong as well as a way to return arbitrary -- data in case of failure. -- @@ -67,8 +67,8 @@ ---------------------------------------------------------------------------- -- Parse error type --- | Data type that is used to represent ???unexpected\/expected??? items in --- 'ParseError'. The data type is parametrized over the token type @t@. +-- | A data type that is used to represent ???unexpected\/expected??? items in +-- 'ParseError'. It is parametrized over the token type @t@. -- -- @since 5.0.0 data ErrorItem t @@ -106,15 +106,15 @@ -- | @'ParseError' s e@ represents a parse error parametrized over the -- stream type @s@ and the custom data @e@. -- --- 'Semigroup' and 'Monoid' instances of the data type allow to merge parse --- errors from different branches of parsing. When merging two +-- 'Semigroup' and 'Monoid' instances of the data type allow us to merge +-- parse errors from different branches of parsing. When merging two -- 'ParseError's, the longest match is preferred; if positions are the same, -- custom data sets and collections of message items are combined. Note that -- fancy errors take precedence over trivial errors in merging. -- -- @since 7.0.0 data ParseError s e - = -- | Trivial errors, generated by Megaparsec's machinery. The data + = -- | Trivial errors, generated by the Megaparsec's machinery. The data -- constructor includes the offset of error, unexpected token (if any), -- and expected tokens. -- @@ -187,14 +187,14 @@ mapParseError _ (TrivialError o u p) = TrivialError o u p mapParseError f (FancyError o x) = FancyError o (E.map (fmap f) x) --- | Get offset of 'ParseError'. +-- | Get the offset of a 'ParseError'. -- -- @since 7.0.0 errorOffset :: ParseError s e -> Int errorOffset (TrivialError o _ _) = o errorOffset (FancyError o _) = o --- | Set offset of 'ParseError'. +-- | Set the offset of a 'ParseError'. -- -- @since 8.0.0 setErrorOffset :: Int -> ParseError s e -> ParseError s e @@ -239,13 +239,13 @@ {-# INLINE mergeError #-} -- | A non-empty collection of 'ParseError's equipped with 'PosState' that --- allows to pretty-print the errors efficiently and correctly. +-- allows us to pretty-print the errors efficiently and correctly. -- -- @since 7.0.0 data ParseErrorBundle s e = ParseErrorBundle { -- | A collection of 'ParseError's that is sorted by parse error offsets bundleErrors :: NonEmpty (ParseError s e), - -- | State that is used for line\/column calculation + -- | The state that is used for line\/column calculation bundlePosState :: PosState s } deriving (Generic) @@ -302,7 +302,7 @@ displayException = errorBundlePretty -- | Attach 'SourcePos'es to items in a 'Traversable' container given that --- there is a projection allowing to get an offset per item. +-- there is a projection allowing us to get an offset per item. -- -- Items must be in ascending order with respect to their offsets. -- @@ -315,8 +315,7 @@ t a -> -- | Initial 'PosState' PosState s -> - -- | The collection with 'SourcePos'es - -- added and the final 'PosState' + -- | The collection with 'SourcePos'es added and the final 'PosState' (t (a, SourcePos), PosState s) attachSourcePos projectOffset xs = runState (traverse f xs) where @@ -349,8 +348,8 @@ -- | Pretty-print a 'ParseErrorBundle'. All 'ParseError's in the bundle will -- be pretty-printed in order together with the corresponding offending --- lines by doing a single efficient pass over the input stream. The --- rendered 'String' always ends with a newline. +-- lines by doing a single pass over the input stream. The rendered 'String' +-- always ends with a newline. -- -- @since 7.0.0 errorBundlePretty :: @@ -488,7 +487,7 @@ ErrorCustom a -> errorComponentLen a _ -> 1 --- | Transforms a list of error messages into their textual representation. +-- | Transform a list of error messages into their textual representation. messageItemsPretty :: -- | Prefix to prepend String -> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/Text/Megaparsec/Internal.hs new/megaparsec-9.1.0/Text/Megaparsec/Internal.hs --- old/megaparsec-9.0.1/Text/Megaparsec/Internal.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/Text/Megaparsec/Internal.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} @@ -94,8 +93,8 @@ mempty = Hints mempty -- | All information available after parsing. This includes consumption of --- input, success (with returned value) or failure (with parse error), and --- parser state at the end of parsing. +-- input, success (with the returned value) or failure (with the parse +-- error), and parser state at the end of parsing. -- -- See also: 'Consumption', 'Result'. data Reply e s a = Reply (State s e) Consumption (Result s e a) @@ -209,10 +208,6 @@ return = pure (>>=) = pBind -#if !(MIN_VERSION_base(4,13,0)) - fail = Fail.fail -#endif - pBind :: Stream s => ParsecT e s m a -> @@ -287,7 +282,7 @@ -- | 'mzero' is a parser that __fails__ without consuming input. -- -- __Note__: strictly speaking, this instance is unlawful. The right --- identity law is does not hold, e.g. in general this is not true: +-- identity law does not hold, e.g. in general this is not true: -- -- > v >> mzero = mero -- @@ -580,7 +575,7 @@ ---------------------------------------------------------------------------- -- Helper functions --- | Convert 'ParseError' record to 'Hints'. +-- | Convert a 'ParseError' record into 'Hints'. toHints :: Stream s => -- | Current offset in input stream @@ -660,7 +655,7 @@ -- | Transform any custom errors thrown by the parser using the given -- function. Similar in function and purpose to @withExceptT@. -- --- __Note__ that the inner parser will start with empty collection of +-- __Note__ that the inner parser will start with an empty collection of -- ???delayed??? 'ParseError's. Any delayed 'ParseError's produced in the inner -- parser will be lifted by applying the provided function and added to the -- collection of delayed parse errors of the outer parser. @@ -692,5 +687,4 @@ eok' x st hs = eok x (adjustState st) hs eerr' e st = eerr (mapParseError f e) (adjustState st) in unParser p s' cok' cerr' eok' eerr' - where {-# INLINE withParsecT #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/Text/Megaparsec/Lexer.hs new/megaparsec-9.1.0/Text/Megaparsec/Lexer.hs --- old/megaparsec-9.0.1/Text/Megaparsec/Lexer.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/Text/Megaparsec/Lexer.hs 2001-09-09 03:46:40.000000000 +0200 @@ -30,18 +30,19 @@ ---------------------------------------------------------------------------- -- White space --- | @'space' sc lineComment blockComment@ produces parser that can parse +-- | @'space' sc lineComment blockComment@ produces a parser that can parse -- white space in general. It's expected that you create such a parser once -- and pass it to other functions in this module as needed (when you see -- @spaceConsumer@ in documentation, usually it means that something like -- 'space' is expected there). -- --- @sc@ is used to parse blocks of space characters. You can use 'C.space1' --- from "Text.Megaparsec.Char" for this purpose as well as your own parser --- (if you don't want to automatically consume newlines, for example). Make --- sure the parser does not succeed on empty input though. In earlier --- version 'C.spaceChar' was recommended, but now parsers based on --- 'takeWhile1P' are preferred because of their speed. +-- @sc@ is used to parse blocks of space characters. You can use +-- 'Text.Megaparsec.Char.space1' from "Text.Megaparsec.Char" for this +-- purpose as well as your own parser (if you don't want to automatically +-- consume newlines, for example). Make sure that the parser does not +-- succeed on the empty input though. In an earlier version of the library +-- 'Text.Megaparsec.Char.spaceChar' was recommended, but now parsers based +-- on 'takeWhile1P' are preferred because of their speed. -- -- @lineComment@ is used to parse line comments. You can use -- @skipLineComment@ if you don't need anything special. @@ -57,7 +58,7 @@ space :: MonadParsec e s m => -- | A parser for space characters which does not accept empty - -- input (e.g. 'C.space1') + -- input (e.g. 'Text.Megaparsec.Char.space1') m () -> -- | A parser for a line comment (e.g. 'skipLineComment') m () -> @@ -70,7 +71,7 @@ [hidden sp, hidden line, hidden block] {-# INLINEABLE space #-} --- | This is a wrapper for lexemes. Typical usage is to supply the first +-- | This is a wrapper for lexemes. The typical usage is to supply the first -- argument (parser that consumes white space, probably defined via 'space') -- and use the resulting function to wrap parsers for every lexeme. -- @@ -110,7 +111,7 @@ symbol spc = lexeme spc . string {-# INLINEABLE symbol #-} --- | Case-insensitive version of 'symbol'. This may be helpful if you're +-- | A case-insensitive version of 'symbol'. This may be helpful if you're -- working with case-insensitive languages. symbol' :: (MonadParsec e s m, CI.FoldCase (Tokens s)) => diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/Text/Megaparsec/State.hs new/megaparsec-9.1.0/Text/Megaparsec/State.hs --- old/megaparsec-9.0.1/Text/Megaparsec/State.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/Text/Megaparsec/State.hs 2001-09-09 03:46:40.000000000 +0200 @@ -74,8 +74,8 @@ instance (NFData s, NFData (ParseError s e)) => NFData (State s e) --- | Special kind of state that is used to calculate line\/column positions --- on demand. +-- | A special kind of state that is used to calculate line\/column +-- positions on demand. -- -- @since 7.0.0 data PosState s = PosState diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/Text/Megaparsec.hs new/megaparsec-9.1.0/Text/Megaparsec.hs --- old/megaparsec-9.0.1/Text/Megaparsec.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/Text/Megaparsec.hs 2001-09-09 03:46:40.000000000 +0200 @@ -23,7 +23,7 @@ -- at the tutorial <https://markkarpov.com/tutorial/megaparsec.html>. -- -- In addition to the "Text.Megaparsec" module, which exports and re-exports --- most everything that you may need, we advise to import +-- almost everything that you may need, we advise to import -- "Text.Megaparsec.Char" if you plan to work with a stream of 'Char' tokens -- or "Text.Megaparsec.Byte" if you intend to parse binary data. -- @@ -191,15 +191,15 @@ -- -- The function is supposed to be useful for lightweight parsing, where -- error messages (and thus file names) are not important and entire input --- should be parsed. For example, it can be used when parsing of a single --- number according to a specification of its format is desired. +-- should be consumed. For example, it can be used for parsing of a single +-- number according to a specification of its format. parseMaybe :: (Ord e, Stream s) => Parsec e s a -> s -> Maybe a parseMaybe p s = case parse (p <* eof) "" s of Left _ -> Nothing Right x -> Just x --- | The expression @'parseTest' p input@ applies the parser @p@ against the +-- | The expression @'parseTest' p input@ applies the parser @p@ on the -- input @input@ and prints the result to stdout. Useful for testing. parseTest :: ( ShowErrorComponent e, @@ -234,9 +234,9 @@ runParser p name s = snd $ runParser' p (initialState name s) -- | The function is similar to 'runParser' with the difference that it --- accepts and returns parser state. This allows to specify arbitrary --- textual position at the beginning of parsing, for example. This is the --- most general way to run a parser over the 'Identity' monad. +-- accepts and returns the parser state. This allows us e.g. to specify +-- arbitrary textual position at the beginning of parsing. This is the most +-- general way to run a parser over the 'Identity' monad. -- -- @since 4.2.0 runParser' :: @@ -291,7 +291,8 @@ Error e -> (s', Left (toBundle (e :| stateParseErrors s'))) --- | Given name of source file and input construct initial state for parser. +-- | Given the name of source file and the input construct the initial state +-- for a parser. initialState :: String -> s -> State s e initialState name s = State @@ -395,7 +396,7 @@ -- | Register a 'ParseError' for later reporting. This action does not end -- parsing and has no effect except for adding the given 'ParseError' to the -- collection of ???delayed??? 'ParseError's which will be taken into --- consideration at the end of parsing. Only if this collection is empty +-- consideration at the end of parsing. Only if this collection is empty the -- parser will succeed. This is the main way to report several parse errors -- at once. -- @@ -461,6 +462,10 @@ -- > digitChar = satisfy isDigit <?> "digit" -- > oneOf cs = satisfy (`elem` cs) -- +-- __Performance note__: when you need to parse a single token, it is often +-- a good idea to use 'satisfy' with the right predicate function instead of +-- creating a complex parser using the combinators. +-- -- See also: 'anySingle', 'anySingleBut', 'oneOf', 'noneOf'. -- -- @since 7.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/bench/memory/Main.hs new/megaparsec-9.1.0/bench/memory/Main.hs --- old/megaparsec-9.0.1/bench/memory/Main.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/bench/memory/Main.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} @@ -17,10 +16,6 @@ import qualified Text.Megaparsec.Char.Lexer as L import Weigh -#if !MIN_VERSION_base(4,13,0) -import Data.Semigroup ((<>)) -#endif - -- | The type of parser that consumes 'String's. type Parser = Parsec Void Text @@ -86,7 +81,7 @@ p' (s, n) = parse (p (s, n)) "" s func (name ++ "-" ++ show i) p' arg --- | Bench the 'errorBundlePretty' function. +-- | Benchmark the 'errorBundlePretty' function. bbundle :: -- | Name of the benchmark String -> @@ -121,7 +116,7 @@ errorBundlePretty bundle --- | Bench the 'reachOffset' function. +-- | Benchmark the 'reachOffset' function. breachOffset :: -- | Starting offset in 'PosState' Int -> @@ -147,7 +142,7 @@ pstateLinePrefix = "" } --- | Bench the 'reachOffsetNoLine' function. +-- | Benchmark the 'reachOffsetNoLine' function. breachOffsetNoLine :: -- | Starting offset in 'PosState' Int -> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/bench/speed/Main.hs new/megaparsec-9.1.0/bench/speed/Main.hs --- old/megaparsec-9.0.1/bench/speed/Main.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/bench/speed/Main.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} @@ -16,10 +15,6 @@ import Text.Megaparsec.Char import qualified Text.Megaparsec.Char.Lexer as L -#if !MIN_VERSION_base(4,13,0) -import Data.Semigroup ((<>)) -#endif - -- | The type of parser that consumes 'String's. type Parser = Parsec Void Text @@ -82,7 +77,7 @@ bs n = env (return (f n, n)) (bench (show n) . nf p') p' (s, n) = parse (p (s, n)) "" s --- | Bench the 'errorBundlePretty' function. +-- | Benchmark the 'errorBundlePretty' function. bbundle :: -- | Name of the benchmark String -> @@ -116,7 +111,7 @@ ("errorBundlePretty-" ++ show totalLines ++ "-" ++ name) (nf errorBundlePretty bundle) --- | Bench the 'reachOffset' function. +-- | Benchmark the 'reachOffset' function. breachOffset :: -- | Starting offset in 'PosState' Int -> @@ -141,7 +136,7 @@ pstateLinePrefix = "" } --- | Bench the 'reachOffsetNoLine' function. +-- | Benchmark the 'reachOffsetNoLine' function. breachOffsetNoLine :: -- | Starting offset in 'PosState' Int -> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/megaparsec-9.0.1/megaparsec.cabal new/megaparsec-9.1.0/megaparsec.cabal --- old/megaparsec-9.0.1/megaparsec.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/megaparsec-9.1.0/megaparsec.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,6 +1,6 @@ cabal-version: 1.18 name: megaparsec -version: 9.0.1 +version: 9.1.0 license: BSD2 license-file: LICENSE.md maintainer: Mark Karpov <[email protected]> @@ -9,7 +9,7 @@ Paolo Martini <[email protected]>, Daan Leijen <[email protected]> -tested-with: ghc ==8.6.5 ghc ==8.8.4 ghc ==8.10.2 +tested-with: ghc ==8.8.4 ghc ==8.10.5 ghc ==9.0.1 homepage: https://github.com/mrkkrp/megaparsec bug-reports: https://github.com/mrkkrp/megaparsec/issues synopsis: Monadic parser combinators @@ -55,8 +55,8 @@ default-language: Haskell2010 build-depends: - base >=4.12 && <5.0, - bytestring >=0.2 && <0.11, + base >=4.13 && <5.0, + bytestring >=0.2 && <0.12, case-insensitive >=1.2 && <1.3, containers >=0.5 && <0.7, deepseq >=1.3 && <1.5, @@ -83,11 +83,11 @@ hs-source-dirs: bench/speed default-language: Haskell2010 build-depends: - base >=4.12 && <5.0, + base >=4.13 && <5.0, containers >=0.5 && <0.7, criterion >=0.6.2.1 && <1.6, deepseq >=1.3 && <1.5, - megaparsec -any, + megaparsec, text >=0.2 && <1.3 if flag(dev) @@ -102,10 +102,10 @@ hs-source-dirs: bench/memory default-language: Haskell2010 build-depends: - base >=4.12 && <5.0, + base >=4.13 && <5.0, containers >=0.5 && <0.7, deepseq >=1.3 && <1.5, - megaparsec -any, + megaparsec, text >=0.2 && <1.3, weigh >=0.0.4 ++++++ megaparsec.cabal ++++++ --- /var/tmp/diff_new_pack.jHtmMv/_old 2021-08-25 20:57:54.433184901 +0200 +++ /var/tmp/diff_new_pack.jHtmMv/_new 2021-08-25 20:57:54.433184901 +0200 @@ -1,6 +1,6 @@ cabal-version: 1.18 name: megaparsec -version: 9.0.1 +version: 9.1.0 x-revision: 1 license: BSD2 license-file: LICENSE.md @@ -10,7 +10,7 @@ Paolo Martini <[email protected]>, Daan Leijen <[email protected]> -tested-with: ghc ==8.6.5 ghc ==8.8.4 ghc ==8.10.2 +tested-with: ghc ==8.8.4 ghc ==8.10.5 ghc ==9.0.1 homepage: https://github.com/mrkkrp/megaparsec bug-reports: https://github.com/mrkkrp/megaparsec/issues synopsis: Monadic parser combinators @@ -56,14 +56,14 @@ default-language: Haskell2010 build-depends: - base >=4.12 && <5.0, + base >=4.13 && <5.0, bytestring >=0.2 && <0.12, case-insensitive >=1.2 && <1.3, containers >=0.5 && <0.7, deepseq >=1.3 && <1.5, mtl >=2.2.2 && <3.0, parser-combinators >=1.0 && <2.0, - scientific >=0.3.1 && <0.4, + scientific >=0.3.7 && <0.4, text >=0.2 && <1.3, transformers >=0.4 && <0.6 @@ -84,11 +84,11 @@ hs-source-dirs: bench/speed default-language: Haskell2010 build-depends: - base >=4.12 && <5.0, + base >=4.13 && <5.0, containers >=0.5 && <0.7, criterion >=0.6.2.1 && <1.6, deepseq >=1.3 && <1.5, - megaparsec -any, + megaparsec, text >=0.2 && <1.3 if flag(dev) @@ -103,10 +103,10 @@ hs-source-dirs: bench/memory default-language: Haskell2010 build-depends: - base >=4.12 && <5.0, + base >=4.13 && <5.0, containers >=0.5 && <0.7, deepseq >=1.3 && <1.5, - megaparsec -any, + megaparsec, text >=0.2 && <1.3, weigh >=0.0.4
