Hello community,

here is the log from the commit of package ghc-smallcheck for openSUSE:Factory 
checked in at 2018-07-24 17:21:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-smallcheck (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-smallcheck.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-smallcheck"

Tue Jul 24 17:21:58 2018 rev:4 rq:623856 version:1.1.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-smallcheck/ghc-smallcheck.changes    
2018-05-30 12:27:15.586375495 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-smallcheck.new/ghc-smallcheck.changes       
2018-07-24 17:22:00.091270499 +0200
@@ -1,0 +2,19 @@
+Wed Jul 18 14:26:41 UTC 2018 - [email protected]
+
+- Cosmetic: replace tabs with blanks, strip trailing white space,
+  and update copyright headers with spec-cleaner.
+
+-------------------------------------------------------------------
+Fri Jul 13 14:31:42 UTC 2018 - [email protected]
+
+- Update smallcheck to version 1.1.5.
+  Version 1.1.5
+  -------------
+
+  * Add `limit :: Monad m => Int -> Series m a -> Series m a`
+  * Add `genericSeries` and `genericCoseries`, so that you can use the generic
+    implementations more flexibly. Previously, the generic implementation was
+    only avaialable as the default method for `series`/`coseries` but not as
+    standalone functions.
+
+-------------------------------------------------------------------
@@ -20 +38,0 @@
-

Old:
----
  smallcheck-1.1.4.tar.gz

New:
----
  smallcheck-1.1.5.tar.gz

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

Other differences:
------------------
++++++ ghc-smallcheck.spec ++++++
--- /var/tmp/diff_new_pack.CfoQrG/_old  2018-07-24 17:22:00.819271430 +0200
+++ /var/tmp/diff_new_pack.CfoQrG/_new  2018-07-24 17:22:00.823271435 +0200
@@ -18,7 +18,7 @@
 
 %global pkg_name smallcheck
 Name:           ghc-%{pkg_name}
-Version:        1.1.4
+Version:        1.1.5
 Release:        0
 Summary:        A property-based testing library
 License:        BSD-3-Clause

++++++ smallcheck-1.1.4.tar.gz -> smallcheck-1.1.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/smallcheck-1.1.4/CHANGELOG.md 
new/smallcheck-1.1.5/CHANGELOG.md
--- old/smallcheck-1.1.4/CHANGELOG.md   2018-05-12 16:05:11.000000000 +0200
+++ new/smallcheck-1.1.5/CHANGELOG.md   2018-07-05 10:17:01.000000000 +0200
@@ -1,6 +1,15 @@
 Changes
 =======
 
+Version 1.1.5
+-------------
+
+* Add `limit :: Monad m => Int -> Series m a -> Series m a`
+* Add `genericSeries` and `genericCoseries`, so that you can use the generic
+  implementations more flexibly. Previously, the generic implementation was
+  only avaialable as the default method for `series`/`coseries` but not as
+  standalone functions.
+
 Version 1.1.4
 -------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/smallcheck-1.1.4/Test/SmallCheck/Series.hs 
new/smallcheck-1.1.5/Test/SmallCheck/Series.hs
--- old/smallcheck-1.1.4/Test/SmallCheck/Series.hs      2018-05-12 
15:59:45.000000000 +0200
+++ new/smallcheck-1.1.5/Test/SmallCheck/Series.hs      2018-06-04 
16:34:44.000000000 +0200
@@ -24,7 +24,7 @@
 --------------------------------------------------------------------
 
 {-# LANGUAGE CPP, RankNTypes, MultiParamTypeClasses, FlexibleInstances,
-             GeneralizedNewtypeDeriving, FlexibleContexts #-}
+             GeneralizedNewtypeDeriving, FlexibleContexts, ScopedTypeVariables 
#-}
 -- The following is needed for generic instances
 {-# LANGUAGE DefaultSignatures, FlexibleContexts, TypeOperators,
              TypeSynonymInstances, FlexibleInstances, OverlappingInstances #-}
@@ -165,6 +165,10 @@
   -- * Basic definitions
   Depth, Series, Serial(..), CoSerial(..),
 
+  -- * Generic implementations
+  genericSeries,
+  genericCoseries,
+
   -- * Convenient wrappers
   Positive(..), NonNegative(..), NonEmpty(..),
 
@@ -174,6 +178,7 @@
   decDepth,
   getDepth,
   generate,
+  limit,
   listSeries,
   list,
   listM,
@@ -204,7 +209,12 @@
   series   :: Series m a
 
   default series :: (Generic a, GSerial m (Rep a)) => Series m a
-  series = to <$> gSeries
+  series = genericSeries
+
+genericSeries
+  :: (Monad m, Generic a, GSerial m (Rep a))
+  => Series m a
+genericSeries = to <$> gSeries
 
 class Monad m => CoSerial m a where
   -- | A proper 'coseries' implementation should pass the depth unchanged to
@@ -213,8 +223,12 @@
   coseries :: Series m b -> Series m (a->b)
 
   default coseries :: (Generic a, GCoSerial m (Rep a)) => Series m b -> Series 
m (a->b)
-  coseries rs = (. from) <$> gCoseries rs
+  coseries = genericCoseries
 
+genericCoseries
+  :: (Monad m, Generic a, GCoSerial m (Rep a))
+  => Series m b -> Series m (a->b)
+genericCoseries rs = (. from) <$> gCoseries rs
 -- }}}
 
 ------------------------------
@@ -229,6 +243,18 @@
   d <- getDepth
   msum $ map return $ f d
 
+-- | Limit a 'Series' to its first @n@ elements
+limit :: forall m a . Monad m => Int -> Series m a -> Series m a
+limit n0 (Series s) = Series $ go n0 s
+  where
+    go :: MonadLogic ml => Int -> ml b -> ml b
+    go 0 _ = mzero
+    go n mb1 = do
+      cons :: Maybe (b, ml b) <- msplit mb1
+      case cons of
+        Nothing -> mzero
+        Just (b, mb2) -> return b `mplus` go (n-1) mb2
+
 suchThat :: Series m a -> (a -> Bool) -> Series m a
 suchThat s p = s >>= \x -> if p x then pure x else empty
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/smallcheck-1.1.4/smallcheck.cabal 
new/smallcheck-1.1.5/smallcheck.cabal
--- old/smallcheck-1.1.4/smallcheck.cabal       2018-05-12 16:04:18.000000000 
+0200
+++ new/smallcheck-1.1.5/smallcheck.cabal       2018-07-05 10:17:08.000000000 
+0200
@@ -1,5 +1,5 @@
 Name:          smallcheck
-Version:       1.1.4
+Version:       1.1.5
 Cabal-Version: >= 1.6
 License:       BSD3
 License-File:  LICENSE


Reply via email to