packages feed

smallcheck 1.1.1 → 1.1.2

raw patch · 5 files changed

+35/−2 lines, 5 files

Files

CHANGELOG.md view
@@ -1,6 +1,12 @@ Changes ======= +Version 1.1.2+-------------++* Export the `test` function+* Add a `listSeries` function+ Version 1.1.1 ------------- 
README.md view
@@ -28,3 +28,11 @@ [comparison]: https://github.com/feuerbach/smallcheck/wiki/Comparison-with-QuickCheck [github]: https://github.com/feuerbach/smallcheck [issues]: https://github.com/feuerbach/smallcheck/issues++Maintainers+-----------++[Roman Cheplyaka](https://github.com/feuerbach) is the primary maintainer.++[Oliver Charles](https://github.com/ocharles) is the backup maintainer. Please+get in touch with him if the primary maintainer cannot be reached.
Test/SmallCheck.hs view
@@ -92,7 +92,7 @@   smallCheck,    -- * Main types and classes-  Testable,+  Testable(..),   Property,   Reason 
Test/SmallCheck/Series.hs view
@@ -174,6 +174,7 @@   decDepth,   getDepth,   generate,+  listSeries,   list,   listM,   fixDepth,@@ -228,8 +229,26 @@ suchThat :: Series m a -> (a -> Bool) -> Series m a suchThat s p = s >>= \x -> if p x then pure x else empty +-- | Given a depth, return the list of values generated by a Serial instance.+--+-- Example, list all integers up to depth 1:+--+-- * @listSeries 1 :: [Int]   -- returns [0,1,-1]@+listSeries :: Serial Identity a => Depth -> [a]+listSeries d = list d series+ -- | Return the list of values generated by a 'Series'. Useful for -- debugging 'Serial' instances.+--+-- Examples:+--+-- * @list 3 'series' :: [Int]                  -- returns [0,1,-1,2,-2,3,-3]@+--+-- * @list 3 ('series' :: 'Series' 'Identity' Int)  -- returns [0,1,-1,2,-2,3,-3]@+--+-- * @list 2 'series' :: [[Bool]]               -- returns [[],[True],[False]]@+--+-- The first two are equivalent. The second has a more explicit type binding. list :: Depth -> Series Identity a -> [a] list d s = runIdentity $ observeAllT $ runSeries d s 
smallcheck.cabal view
@@ -1,5 +1,5 @@ Name:          smallcheck-Version:       1.1.1+Version:       1.1.2 Cabal-Version: >= 1.6 License:       BSD3 License-File:  LICENSE