Hello community,
here is the log from the commit of package ghc-parser-combinators for
openSUSE:Leap:15.2 checked in at 2020-02-19 18:40:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/ghc-parser-combinators (Old)
and /work/SRC/openSUSE:Leap:15.2/.ghc-parser-combinators.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-parser-combinators"
Wed Feb 19 18:40:27 2020 rev:3 rq:771405 version:1.2.1
Changes:
--------
---
/work/SRC/openSUSE:Leap:15.2/ghc-parser-combinators/ghc-parser-combinators.changes
2020-01-15 15:02:26.429810582 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.ghc-parser-combinators.new.26092/ghc-parser-combinators.changes
2020-02-19 18:40:28.786136441 +0100
@@ -1,0 +2,55 @@
+Sat Nov 9 03:01:48 UTC 2019 - [email protected]
+
+- Update parser-combinators to version 1.2.1.
+ ## Parser combinators 1.2.1
+
+ * The tests in `parser-combinators-tests` now work with Megaparsec 8.
+
+ * Dropped support for GHC 8.2.
+
+-------------------------------------------------------------------
+Fri Nov 8 16:14:24 UTC 2019 - Peter Simons <[email protected]>
+
+- Drop obsolete group attributes.
+
+-------------------------------------------------------------------
+Mon Jul 29 02:02:57 UTC 2019 - [email protected]
+
+- Update parser-combinators to version 1.2.0.
+ Upstream has edited the change log file since the last release in
+ a non-trivial way, i.e. they did more than just add a new entry
+ at the top. You can review the file at:
+ http://hackage.haskell.org/package/parser-combinators-1.2.0/src/CHANGELOG.md
+
+-------------------------------------------------------------------
+Sun Jun 9 02:01:43 UTC 2019 - [email protected]
+
+- Update parser-combinators to version 1.1.0.
+ ## Parser combinators 1.1.0
+
+ * Added support for ternary operators; see `TernR` in
+ `Control.Monad.Combinators.Expr`.
+
+-------------------------------------------------------------------
+Sat May 11 02:00:52 UTC 2019 - [email protected]
+
+- Update parser-combinators to version 1.0.3.
+ ## Parser combinators 1.0.3
+
+ * Dropped support for GHC 7.10.
+
+ * Added a test suite as a separate package called
+ `parser-combinators-tests`.
+
+-------------------------------------------------------------------
+Sat Apr 6 02:02:45 UTC 2019 - [email protected]
+
+- Update parser-combinators to version 1.0.2.
+ ## Parser combinators 1.0.2
+
+ * Defined `liftA2` for `Permutation` manually. The new definition should be
+ more efficient.
+
+ * Made inner `Maybe` field in `Permutation` strict.
+
+-------------------------------------------------------------------
Old:
----
parser-combinators-1.0.1.tar.gz
New:
----
parser-combinators-1.2.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-parser-combinators.spec ++++++
--- /var/tmp/diff_new_pack.BLq5Pl/_old 2020-02-19 18:40:29.290137060 +0100
+++ /var/tmp/diff_new_pack.BLq5Pl/_new 2020-02-19 18:40:29.290137060 +0100
@@ -18,11 +18,10 @@
%global pkg_name parser-combinators
Name: ghc-%{pkg_name}
-Version: 1.0.1
+Version: 1.2.1
Release: 0
Summary: Lightweight package providing commonly useful parser
combinators
License: BSD-3-Clause
-Group: Development/Libraries/Haskell
URL: https://hackage.haskell.org/package/%{pkg_name}
Source0:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
BuildRequires: ghc-Cabal-devel
@@ -33,7 +32,6 @@
%package devel
Summary: Haskell %{pkg_name} library development files
-Group: Development/Libraries/Haskell
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
++++++ parser-combinators-1.0.1.tar.gz -> parser-combinators-1.2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/parser-combinators-1.0.1/CHANGELOG.md
new/parser-combinators-1.2.1/CHANGELOG.md
--- old/parser-combinators-1.0.1/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
+++ new/parser-combinators-1.2.1/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
@@ -1,3 +1,36 @@
+## Parser combinators 1.2.1
+
+* The tests in `parser-combinators-tests` now work with Megaparsec 8.
+
+* Dropped support for GHC 8.2.
+
+## Parser combinators 1.2.0
+
+* Added `manyTill_` and `someTill_` combinators which work like the older
+ `manyTill` and `someTill` except they also return the result of the `end`
+ parser.
+
+* Dropped support for GHC 8.0.
+
+## Parser combinators 1.1.0
+
+* Added support for ternary operators; see `TernR` in
+ `Control.Monad.Combinators.Expr`.
+
+## Parser combinators 1.0.3
+
+* Dropped support for GHC 7.10.
+
+* Added a test suite as a separate package called
+ `parser-combinators-tests`.
+
+## Parser combinators 1.0.2
+
+* Defined `liftA2` for `Permutation` manually. The new definition should be
+ more efficient.
+
+* Made inner `Maybe` field in `Permutation` strict.
+
## Parser combinators 1.0.1
* Cosmetic changes in the source code.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/parser-combinators-1.0.1/Control/Applicative/Combinators/NonEmpty.hs
new/parser-combinators-1.2.1/Control/Applicative/Combinators/NonEmpty.hs
--- old/parser-combinators-1.0.1/Control/Applicative/Combinators/NonEmpty.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/parser-combinators-1.2.1/Control/Applicative/Combinators/NonEmpty.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
-- |
-- Module : Control.Applicative.Combinators
--- Copyright : © 2017–2019 Mark Karpov
+-- Copyright : © 2017–present Mark Karpov
-- License : BSD 3 clause
--
-- Maintainer : Mark Karpov <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/parser-combinators-1.0.1/Control/Applicative/Combinators.hs
new/parser-combinators-1.2.1/Control/Applicative/Combinators.hs
--- old/parser-combinators-1.0.1/Control/Applicative/Combinators.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/parser-combinators-1.2.1/Control/Applicative/Combinators.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
-- |
-- Module : Control.Applicative.Combinators
--- Copyright : © 2017–2019 Mark Karpov
+-- Copyright : © 2017–present Mark Karpov
-- License : BSD 3 clause
--
-- Maintainer : Mark Karpov <[email protected]>
@@ -43,7 +43,7 @@
-- composite parsers in @try@ to achieve correct behavior.
{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE CPP #-}
+{-# LANGUAGE TupleSections #-}
module Control.Applicative.Combinators
( -- * Re-exports from "Control.Applicative"
@@ -67,7 +67,9 @@
, endBy
, endBy1
, manyTill
+ , manyTill_
, someTill
+ , someTill_
, option
, sepBy
, sepBy1
@@ -81,11 +83,8 @@
where
import Control.Applicative
-import Data.Foldable
-
-#if MIN_VERSION_base(4,9,0)
import Control.Monad (replicateM, replicateM_)
-#endif
+import Data.Foldable
----------------------------------------------------------------------------
-- Re-exports from "Control.Applicative"
@@ -156,11 +155,7 @@
-- See also: 'skipCount', 'count''.
count :: Applicative m => Int -> m a -> m [a]
-#if MIN_VERSION_base(4,9,0)
count = replicateM
-#else
-count n p = sequenceA (replicate n p)
-#endif
{-# INLINE count #-}
-- | @'count'' m n p@ parses from @m@ to @n@ occurrences of @p@. If @n@ is
@@ -206,7 +201,8 @@
{-# INLINE endBy1 #-}
-- | @'manyTill' p end@ applies parser @p@ /zero/ or more times until parser
--- @end@ succeeds. Returns the list of values returned by @p@.
+-- @end@ succeeds. Returns the list of values returned by @p@. @end@ result
+-- is consumed and lost. Use 'manyTill_' if you wish to keep it.
--
-- See also: 'skipMany', 'skipManyTill'.
@@ -216,8 +212,26 @@
go = ([] <$ end) <|> liftA2 (:) p go
{-# INLINE manyTill #-}
+-- | @'manyTill_' p end@ applies parser @p@ /zero/ or more times until
+-- parser @end@ succeeds. Returns the list of values returned by @p@ and the
+-- @end@ result. Use 'manyTill' if you have no need in the result of the
+-- @end@.
+--
+-- See also: 'skipMany', 'skipManyTill'.
+--
+-- @since 1.2.0
+
+manyTill_ :: Alternative m => m a -> m end -> m ([a], end)
+manyTill_ p end = go
+ where
+ go = (([],) <$> end) <|> liftA2 (\x (xs, y) -> (x:xs, y)) p go
+{-# INLINE manyTill_ #-}
+
-- | @'someTill' p end@ works similarly to @'manyTill' p end@, but @p@
--- should succeed at least once.
+-- should succeed at least once. @end@ result is consumed and lost. Use
+-- 'someTill_' if you wish to keep it.
+--
+-- > someTill p end = liftA2 (:) p (manyTill p end)
--
-- See also: 'skipSome', 'skipSomeTill'.
@@ -225,6 +239,19 @@
someTill p end = liftA2 (:) p (manyTill p end)
{-# INLINE someTill #-}
+-- | @'someTill_' p end@ works similarly to @'manyTill_' p end@, but @p@
+-- should succeed at least once. Use 'someTill' if you have no need in the
+-- result of the @end@.
+--
+-- See also: 'skipSome', 'skipSomeTill'.
+--
+-- @since 1.2.0
+
+someTill_ :: Alternative m => m a -> m end -> m ([a], end)
+someTill_ p end =
+ liftA2 (\x (xs, y) -> (x:xs, y)) p (manyTill_ p end)
+{-# INLINE someTill_ #-}
+
-- | @'option' x p@ tries to apply the parser @p@. If @p@ fails without
-- consuming input, it returns the value @x@, otherwise the value returned
-- by @p@.
@@ -298,11 +325,7 @@
-- @since 0.3.0
skipCount :: Applicative m => Int -> m a -> m ()
-#if MIN_VERSION_base(4,9,0)
skipCount = replicateM_
-#else
-skipCount n p = sequenceA_ (replicate n p)
-#endif
{-# INLINE skipCount #-}
-- | @'skipManyTill' p end@ applies the parser @p@ /zero/ or more times
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/parser-combinators-1.0.1/Control/Applicative/Permutations.hs
new/parser-combinators-1.2.1/Control/Applicative/Permutations.hs
--- old/parser-combinators-1.0.1/Control/Applicative/Permutations.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/parser-combinators-1.2.1/Control/Applicative/Permutations.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
-- |
-- Module : Control.Applicative.Permutations
--- Copyright : © 2017–2019 Alex Washburn
+-- Copyright : © 2017–present Alex Washburn
-- License : BSD 3 clause
--
-- Maintainer : Mark Karpov <[email protected]>
@@ -55,7 +55,7 @@
-- | An 'Applicative' wrapper-type for constructing permutation parsers.
-data Permutation m a = P (Maybe a) (m (Permutation m a))
+data Permutation m a = P !(Maybe a) (m (Permutation m a))
instance Functor m => Functor (Permutation m) where
fmap f (P v p) = P (f <$> v) (fmap f <$> p)
@@ -66,6 +66,10 @@
where
lhsAlt = (<*> rhs) <$> v
rhsAlt = (lhs <*>) <$> w
+ liftA2 f lhs@(P x v) rhs@(P y w) = P (liftA2 f x y) (lhsAlt <|> rhsAlt)
+ where
+ lhsAlt = (\p -> liftA2 f p rhs) <$> v
+ rhsAlt = liftA2 f lhs <$> w
-- | \"Unlifts\" a permutation parser into a parser to be evaluated.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/parser-combinators-1.0.1/Control/Monad/Combinators/Expr.hs
new/parser-combinators-1.2.1/Control/Monad/Combinators/Expr.hs
--- old/parser-combinators-1.0.1/Control/Monad/Combinators/Expr.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/parser-combinators-1.2.1/Control/Monad/Combinators/Expr.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
-- |
-- Module : Control.Monad.Combinators.Expr
--- Copyright : © 2017–2019 Mark Karpov
+-- Copyright : © 2017–present Mark Karpov
-- License : BSD 3 clause
--
-- Maintainer : Mark Karpov <[email protected]>
@@ -30,6 +30,18 @@
| InfixR (m (a -> a -> a)) -- ^ Right-associative infix
| Prefix (m (a -> a)) -- ^ Prefix
| Postfix (m (a -> a)) -- ^ Postfix
+ | TernR (m (m (a -> a -> a -> a)))
+ -- ^ Right-associative ternary. Right-associative means that
+ -- @a ? b : d ? e : f@ parsed as
+ -- @a ? b : (d ? e : f)@ and not as @(a ? b : d) ? e : f@.
+ --
+ -- The outer monadic action parses the first separator (e.g. @?@) and
+ -- returns an action (of type @m (a -> a -> a -> a)@) that parses the
+ -- second separator (e.g. @:@).
+ --
+ -- Example usage:
+ --
+ -- >>> TernR ((If <$ char ':') <$ char '?')
-- | @'makeExprParser' term table@ builds an expression parser for terms
-- @term@ with operators from @table@, taking the associativity and
@@ -89,13 +101,14 @@
addPrecLevel :: MonadPlus m => m a -> [Operator m a] -> m a
addPrecLevel term ops =
- term' >>= \x -> choice [ras' x, las' x, nas' x, return x]
+ term' >>= \x -> choice [ras' x, las' x, nas' x, tern' x, return x]
where
- (ras, las, nas, prefix, postfix) = foldr splitOp ([],[],[],[],[]) ops
+ (ras, las, nas, prefix, postfix, tern) = foldr splitOp ([],[],[],[],[],[])
ops
term' = pTerm (choice prefix) term (choice postfix)
ras' = pInfixR (choice ras) term'
las' = pInfixL (choice las) term'
nas' = pInfixN (choice nas) term'
+ tern' = pTernR (choice tern) term'
{-# INLINEABLE addPrecLevel #-}
-- | @pTerm prefix term postfix@ parses a @term@ surrounded by optional
@@ -144,19 +157,33 @@
return $ f x y
{-# INLINE pInfixR #-}
+-- | Parse the first separator of a ternary operator
+
+pTernR :: MonadPlus m => m (m (a -> a -> a -> a)) -> m a -> a -> m a
+pTernR sep1 p x = do
+ sep2 <- sep1
+ y <- p >>= \r -> pTernR sep1 p r `mplus` return r
+ f <- sep2
+ z <- p >>= \r -> pTernR sep1 p r `mplus` return r
+ return $ f x y z
+{-# INLINE pTernR #-}
+
type Batch m a =
( [m (a -> a -> a)]
, [m (a -> a -> a)]
, [m (a -> a -> a)]
, [m (a -> a)]
- , [m (a -> a)] )
+ , [m (a -> a)]
+ , [m (m (a -> a -> a -> a))]
+ )
-- | A helper to separate various operators (binary, unary, and according to
-- associativity) and return them in a tuple.
splitOp :: Operator m a -> Batch m a -> Batch m a
-splitOp (InfixR op) (r, l, n, pre, post) = (op:r, l, n, pre, post)
-splitOp (InfixL op) (r, l, n, pre, post) = (r, op:l, n, pre, post)
-splitOp (InfixN op) (r, l, n, pre, post) = (r, l, op:n, pre, post)
-splitOp (Prefix op) (r, l, n, pre, post) = (r, l, n, op:pre, post)
-splitOp (Postfix op) (r, l, n, pre, post) = (r, l, n, pre, op:post)
+splitOp (InfixR op) (r, l, n, pre, post, tern) = (op:r, l, n, pre, post, tern)
+splitOp (InfixL op) (r, l, n, pre, post, tern) = (r, op:l, n, pre, post, tern)
+splitOp (InfixN op) (r, l, n, pre, post, tern) = (r, l, op:n, pre, post, tern)
+splitOp (Prefix op) (r, l, n, pre, post, tern) = (r, l, n, op:pre, post, tern)
+splitOp (Postfix op) (r, l, n, pre, post, tern) = (r, l, n, pre, op:post, tern)
+splitOp (TernR op) (r, l, n, pre, post, tern) = (r, l, n, pre, post, op:tern)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/parser-combinators-1.0.1/Control/Monad/Combinators/NonEmpty.hs
new/parser-combinators-1.2.1/Control/Monad/Combinators/NonEmpty.hs
--- old/parser-combinators-1.0.1/Control/Monad/Combinators/NonEmpty.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/parser-combinators-1.2.1/Control/Monad/Combinators/NonEmpty.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
-- |
-- Module : Control.Monad.Combinators.NonEmpty
--- Copyright : © 2017–2019 Mark Karpov
+-- Copyright : © 2017–present Mark Karpov
-- License : BSD 3 clause
--
-- Maintainer : Mark Karpov <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/parser-combinators-1.0.1/Control/Monad/Combinators.hs
new/parser-combinators-1.2.1/Control/Monad/Combinators.hs
--- old/parser-combinators-1.0.1/Control/Monad/Combinators.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/parser-combinators-1.2.1/Control/Monad/Combinators.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
-- |
-- Module : Control.Monad.Combinators
--- Copyright : © 2017–2019 Mark Karpov
+-- Copyright : © 2017–present Mark Karpov
-- License : BSD 3 clause
--
-- Maintainer : Mark Karpov <[email protected]>
@@ -37,8 +37,10 @@
, endBy1
, many
, manyTill
+ , manyTill_
, some
, someTill
+ , someTill_
, C.option
, sepBy
, sepBy1
@@ -121,7 +123,7 @@
god f !d =
if d > 0
then do
- r <- optional p
+ r <- C.optional p
case r of
Nothing -> return (f [])
Just x -> god (f . (x:)) (d - 1)
@@ -134,14 +136,14 @@
-- > cStatements = cStatement `endBy` semicolon
endBy :: MonadPlus m => m a -> m sep -> m [a]
-endBy p sep = many (p >>= \x -> re x sep)
+endBy p sep = many (p >>= \x -> x <$ sep)
{-# INLINE endBy #-}
-- | @'endBy1' p sep@ parses /one/ or more occurrences of @p@, separated and
-- ended by @sep@. Returns a list of values returned by @p@.
endBy1 :: MonadPlus m => m a -> m sep -> m [a]
-endBy1 p sep = some (p >>= \x -> re x sep)
+endBy1 p sep = some (p >>= \x -> x <$ sep)
{-# INLINE endBy1 #-}
-- | @'many' p@ applies the parser @p@ /zero/ or more times and returns a
@@ -153,28 +155,43 @@
many p = go id
where
go f = do
- r <- optional p
+ r <- C.optional p
case r of
Nothing -> return (f [])
Just x -> go (f . (x:))
{-# INLINE many #-}
-- | @'manyTill' p end@ applies parser @p@ /zero/ or more times until parser
--- @end@ succeeds. Returns the list of values returned by @p@.
+-- @end@ succeeds. Returns the list of values returned by @p@. __Note__ that
+-- @end@ result is consumed and lost. Use 'manyTill_' if you wish to keep
+-- it.
--
-- See also: 'skipMany', 'skipManyTill'.
manyTill :: MonadPlus m => m a -> m end -> m [a]
-manyTill p end = go id
+manyTill p end = fst <$> manyTill_ p end
+{-# INLINE manyTill #-}
+
+-- | @'manyTill_' p end@ applies parser @p@ /zero/ or more times until
+-- parser @end@ succeeds. Returns the list of values returned by @p@ and the
+-- @end@ result. Use 'manyTill' if you have no need in the result of the
+-- @end@.
+--
+-- See also: 'skipMany', 'skipManyTill'.
+--
+-- @since 1.2.0
+
+manyTill_ :: MonadPlus m => m a -> m end -> m ([a], end)
+manyTill_ p end = go id
where
go f = do
- done <- option False (re True end)
- if done
- then return (f [])
- else do
+ done <- C.optional end
+ case done of
+ Just done' -> return (f [], done')
+ Nothing -> do
x <- p
go (f . (x:))
-{-# INLINE manyTill #-}
+{-# INLINE manyTill_ #-}
-- | @'some' p@ applies the parser @p@ /one/ or more times and returns a
-- list of the values returned by @p@.
@@ -186,7 +203,10 @@
{-# INLINE some #-}
-- | @'someTill' p end@ works similarly to @'manyTill' p end@, but @p@
--- should succeed at least once.
+-- should succeed at least once. __Note__ that @end@ result is consumed and
+-- lost. Use 'someTill_' if you wish to keep it.
+--
+-- > someTill p end = liftM2 (:) p (manyTill p end)
--
-- See also: 'skipSome', 'skipSomeTill'.
@@ -194,6 +214,18 @@
someTill p end = liftM2 (:) p (manyTill p end)
{-# INLINE someTill #-}
+-- | @'someTill_' p end@ works similarly to @'manyTill_' p end@, but @p@
+-- should succeed at least once. Use 'someTill' if you have no need in the
+-- result of the @end@.
+--
+-- See also: 'skipSome', 'skipSomeTill'.
+--
+-- @since 1.2.0
+
+someTill_ :: MonadPlus m => m a -> m end -> m ([a], end)
+someTill_ p end = liftM2 (\x (xs, y) -> (x:xs, y)) p (manyTill_ p end)
+{-# INLINE someTill_ #-}
+
-- | @'sepBy' p sep@ parses /zero/ or more occurrences of @p@, separated by
-- @sep@. Returns a list of values returned by @p@.
--
@@ -201,7 +233,7 @@
sepBy :: MonadPlus m => m a -> m sep -> m [a]
sepBy p sep = do
- r <- optional p
+ r <- C.optional p
case r of
Nothing -> return []
Just x -> (x:) <$> many (sep >> p)
@@ -223,11 +255,11 @@
sepEndBy p sep = go id
where
go f = do
- r <- optional p
+ r <- C.optional p
case r of
Nothing -> return (f [])
Just x -> do
- more <- option False (re True sep)
+ more <- C.option False (True <$ sep)
if more
then go (f . (x:))
else return (f [x])
@@ -239,7 +271,7 @@
sepEndBy1 :: MonadPlus m => m a -> m sep -> m [a]
sepEndBy1 p sep = do
x <- p
- more <- option False (re True sep)
+ more <- C.option False (True <$ sep)
if more
then (x:) <$> sepEndBy p sep
else return [x]
@@ -254,7 +286,7 @@
skipMany p = go
where
go = do
- more <- option False (re True p)
+ more <- C.option False (True <$ p)
when more go
{-# INLINE skipMany #-}
@@ -291,7 +323,7 @@
skipManyTill p end = go
where
go = do
- r <- optional end
+ r <- C.optional end
case r of
Nothing -> p >> go
Just x -> return x
@@ -306,18 +338,3 @@
skipSomeTill :: MonadPlus m => m a -> m end -> m end
skipSomeTill p end = p >> skipManyTill p end
{-# INLINE skipSomeTill #-}
-
-----------------------------------------------------------------------------
--- Compat helpers (for older GHCs)
-
-re :: Monad m => a -> m b -> m a
-re x = fmap (const x)
-{-# INLINE re #-}
-
-option :: MonadPlus m => a -> m a -> m a
-option x p = p `mplus` return x
-{-# INLINE option #-}
-
-optional :: MonadPlus m => m a -> m (Maybe a)
-optional p = fmap Just p `mplus` return Nothing
-{-# INLINE optional #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/parser-combinators-1.0.1/LICENSE.md
new/parser-combinators-1.2.1/LICENSE.md
--- old/parser-combinators-1.0.1/LICENSE.md 2001-09-09 03:46:40.000000000
+0200
+++ new/parser-combinators-1.2.1/LICENSE.md 2001-09-09 03:46:40.000000000
+0200
@@ -1,4 +1,4 @@
-Copyright © 2017–2018 Mark Karpov
+Copyright © 2017–present Mark Karpov
All rights reserved.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/parser-combinators-1.0.1/README.md
new/parser-combinators-1.2.1/README.md
--- old/parser-combinators-1.0.1/README.md 2001-09-09 03:46:40.000000000
+0200
+++ new/parser-combinators-1.2.1/README.md 2001-09-09 03:46:40.000000000
+0200
@@ -9,18 +9,17 @@
The package provides common parser combinators defined in terms of
`Applicative` and `Alternative` without any dependencies but `base`. There
are also more efficient versions of the combinators defined in terms of
-`Monad` and `MonadPlus`. Test suite and benchmarks can be found in the
-[Megaparsec repo](https://github.com/mrkkrp/megaparsec).
+`Monad` and `MonadPlus`.
## Contribution
Issues, bugs, and questions may be reported in [the GitHub issue tracker for
this project](https://github.com/mrkkrp/parser-combinators/issues).
-Pull requests are also welcome and will be reviewed quickly.
+Pull requests are also welcome.
## License
-Copyright © 2017–2019 Mark Karpov
+Copyright © 2017–present Mark Karpov
Distributed under BSD 3 clause license.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/parser-combinators-1.0.1/parser-combinators.cabal
new/parser-combinators-1.2.1/parser-combinators.cabal
--- old/parser-combinators-1.0.1/parser-combinators.cabal 2001-09-09
03:46:40.000000000 +0200
+++ new/parser-combinators-1.2.1/parser-combinators.cabal 2001-09-09
03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
name: parser-combinators
-version: 1.0.1
+version: 1.2.1
cabal-version: 1.18
-tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.4,
GHC==8.6.3
+tested-with: GHC==8.4.4, GHC==8.6.5, GHC==8.8.1
license: BSD3
license-file: LICENSE.md
author: Mark Karpov <[email protected]>
@@ -26,11 +26,7 @@
default: False
library
- build-depends: base >= 4.8 && < 5.0
-
- if !impl(ghc >= 8.0)
- build-depends: semigroups == 0.18.*
-
+ build-depends: base >= 4.11 && < 5.0
exposed-modules: Control.Applicative.Combinators
, Control.Applicative.Combinators.NonEmpty
, Control.Applicative.Permutations
@@ -41,10 +37,9 @@
ghc-options: -Wall -Werror
else
ghc-options: -O2 -Wall
- if flag(dev) && impl(ghc >= 8.0)
+ if flag(dev)
ghc-options: -Wcompat
-Wincomplete-record-updates
-Wincomplete-uni-patterns
-Wnoncanonical-monad-instances
- -Wnoncanonical-monadfail-instances
default-language: Haskell2010