Hello community,

here is the log from the commit of package ghc-parser-combinators for 
openSUSE:Factory checked in at 2019-08-13 13:15:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-parser-combinators (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-parser-combinators.new.9556 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-parser-combinators"

Tue Aug 13 13:15:09 2019 rev:7 rq:721032 version:1.2.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/ghc-parser-combinators/ghc-parser-combinators.changes
    2019-06-12 13:18:41.772568179 +0200
+++ 
/work/SRC/openSUSE:Factory/.ghc-parser-combinators.new.9556/ghc-parser-combinators.changes
  2019-08-13 13:15:09.793507103 +0200
@@ -1,0 +2,9 @@
+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
+
+-------------------------------------------------------------------

Old:
----
  parser-combinators-1.1.0.tar.gz

New:
----
  parser-combinators-1.2.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-parser-combinators.spec ++++++
--- /var/tmp/diff_new_pack.vffplz/_old  2019-08-13 13:15:10.313506982 +0200
+++ /var/tmp/diff_new_pack.vffplz/_new  2019-08-13 13:15:10.325506979 +0200
@@ -18,7 +18,7 @@
 
 %global pkg_name parser-combinators
 Name:           ghc-%{pkg_name}
-Version:        1.1.0
+Version:        1.2.0
 Release:        0
 Summary:        Lightweight package providing commonly useful parser 
combinators
 License:        BSD-3-Clause

++++++ parser-combinators-1.1.0.tar.gz -> parser-combinators-1.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/parser-combinators-1.1.0/CHANGELOG.md 
new/parser-combinators-1.2.0/CHANGELOG.md
--- old/parser-combinators-1.1.0/CHANGELOG.md   2019-06-08 23:57:40.000000000 
+0200
+++ new/parser-combinators-1.2.0/CHANGELOG.md   2001-09-09 03:46:40.000000000 
+0200
@@ -1,7 +1,15 @@
+## 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`.
+  `Control.Monad.Combinators.Expr`.
 
 ## Parser combinators 1.0.3
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/parser-combinators-1.1.0/Control/Applicative/Combinators/NonEmpty.hs 
new/parser-combinators-1.2.0/Control/Applicative/Combinators/NonEmpty.hs
--- old/parser-combinators-1.1.0/Control/Applicative/Combinators/NonEmpty.hs    
2019-06-08 23:57:40.000000000 +0200
+++ new/parser-combinators-1.2.0/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.1.0/Control/Applicative/Combinators.hs 
new/parser-combinators-1.2.0/Control/Applicative/Combinators.hs
--- old/parser-combinators-1.1.0/Control/Applicative/Combinators.hs     
2019-06-08 23:57:40.000000000 +0200
+++ new/parser-combinators-1.2.0/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,6 +43,7 @@
 -- composite parsers in @try@ to achieve correct behavior.
 
 {-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE TupleSections #-}
 
 module Control.Applicative.Combinators
   ( -- * Re-exports from "Control.Applicative"
@@ -66,7 +67,9 @@
   , endBy
   , endBy1
   , manyTill
+  , manyTill_
   , someTill
+  , someTill_
   , option
   , sepBy
   , sepBy1
@@ -198,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'.
 
@@ -208,8 +212,24 @@
     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.
 --
 -- See also: 'skipSome', 'skipSomeTill'.
 
@@ -217,6 +237,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@.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/parser-combinators-1.1.0/Control/Applicative/Permutations.hs 
new/parser-combinators-1.2.0/Control/Applicative/Permutations.hs
--- old/parser-combinators-1.1.0/Control/Applicative/Permutations.hs    
2019-06-08 23:57:40.000000000 +0200
+++ new/parser-combinators-1.2.0/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]>
@@ -40,8 +40,6 @@
 --
 -- @since 0.2.0
 
-{-# LANGUAGE CPP #-}
-
 module Control.Applicative.Permutations
   ( -- ** Permutation type
     Permutation
@@ -68,12 +66,10 @@
     where
       lhsAlt = (<*> rhs) <$> v
       rhsAlt = (lhs <*>) <$> w
-#if MIN_VERSION_base(4,10,0)
   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
-#endif
 
 -- | \"Unlifts\" a permutation parser into a parser to be evaluated.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/parser-combinators-1.1.0/Control/Monad/Combinators/Expr.hs 
new/parser-combinators-1.2.0/Control/Monad/Combinators/Expr.hs
--- old/parser-combinators-1.1.0/Control/Monad/Combinators/Expr.hs      
2019-06-08 23:57:40.000000000 +0200
+++ new/parser-combinators-1.2.0/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]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/parser-combinators-1.1.0/Control/Monad/Combinators/NonEmpty.hs 
new/parser-combinators-1.2.0/Control/Monad/Combinators/NonEmpty.hs
--- old/parser-combinators-1.1.0/Control/Monad/Combinators/NonEmpty.hs  
2019-06-08 23:57:40.000000000 +0200
+++ new/parser-combinators-1.2.0/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.1.0/Control/Monad/Combinators.hs 
new/parser-combinators-1.2.0/Control/Monad/Combinators.hs
--- old/parser-combinators-1.1.0/Control/Monad/Combinators.hs   2019-06-08 
23:57:40.000000000 +0200
+++ new/parser-combinators-1.2.0/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,8 @@
 {-# 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.
 --
 -- See also: 'skipSome', 'skipSomeTill'.
 
@@ -194,6 +212,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 +231,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 +253,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 +269,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 +284,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 +321,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 +336,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.1.0/LICENSE.md 
new/parser-combinators-1.2.0/LICENSE.md
--- old/parser-combinators-1.1.0/LICENSE.md     2019-06-08 23:57:40.000000000 
+0200
+++ new/parser-combinators-1.2.0/LICENSE.md     2001-09-09 03:46:40.000000000 
+0200
@@ -1,4 +1,4 @@
-Copyright © 2017–2019 Mark Karpov
+Copyright © 2017–present Mark Karpov
 
 All rights reserved.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/parser-combinators-1.1.0/README.md 
new/parser-combinators-1.2.0/README.md
--- old/parser-combinators-1.1.0/README.md      2019-06-08 23:57:40.000000000 
+0200
+++ new/parser-combinators-1.2.0/README.md      2001-09-09 03:46:40.000000000 
+0200
@@ -20,6 +20,6 @@
 
 ## 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.1.0/parser-combinators.cabal 
new/parser-combinators-1.2.0/parser-combinators.cabal
--- old/parser-combinators-1.1.0/parser-combinators.cabal       2019-06-08 
23:57:40.000000000 +0200
+++ new/parser-combinators-1.2.0/parser-combinators.cabal       2001-09-09 
03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
 name:                 parser-combinators
-version:              1.1.0
+version:              1.2.0
 cabal-version:        1.18
-tested-with:          GHC==8.0.2, GHC==8.2.2, GHC==8.4.4, GHC==8.6.5
+tested-with:          GHC==8.2.2, GHC==8.4.4, GHC==8.6.5
 license:              BSD3
 license-file:         LICENSE.md
 author:               Mark Karpov <[email protected]>
@@ -26,7 +26,7 @@
   default:            False
 
 library
-  build-depends:      base             >= 4.9 && < 5.0
+  build-depends:      base             >= 4.10 && < 5.0
   exposed-modules:    Control.Applicative.Combinators
                     , Control.Applicative.Combinators.NonEmpty
                     , Control.Applicative.Permutations


Reply via email to