safe 0.3.14 → 0.3.15
raw patch · 4 files changed
+7/−5 lines, 4 files
Files
- CHANGES.txt +2/−0
- README.md +1/−1
- Test.hs +3/−3
- safe.cabal +1/−1
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for Safe +0.3.15+ Support QuickCheck 2.10 0.3.14 #20, fix for GHC 7.10.1 0.3.13
README.md view
@@ -1,4 +1,4 @@-# Safe [](https://hackage.haskell.org/package/safe) [](https://travis-ci.org/ndmitchell/safe)+# Safe [](https://hackage.haskell.org/package/safe) [](https://travis-ci.org/ndmitchell/safe) A library wrapping `Prelude`/`Data.List` functions that can throw exceptions, such as `head` and `!!`. Each unsafe function has up to four variants, e.g. with `tail`:
Test.hs view
@@ -58,6 +58,7 @@ f "take" takeExact takeExactMay takeExactNote t f "drop" dropExact dropExactMay dropExactNote d f "splitAt" splitAtExact splitAtExactMay splitAtExactNote (t, d)+ return True take 2 (zipExact [1,2,3] [1,2]) === [(1,1),(2,2)] zipExact [d1,2,3] [d1,2] `errs` ["Safe.Exact.zipExact","first list is longer than the second"]@@ -83,6 +84,7 @@ may xs ys === Nothing f "zip" zipExact zipExactMay zipExactNote f "zipWith" (zipWithExact (,)) (zipWithExactMay (,)) (`zipWithExactNote` (,))+ return True take 2 (zip3Exact [1,2,3] [1,2,3] [1,2]) === [(1,1,1),(2,2,2)] zip3Exact [d1,2] [d1,2,3] [d1,2,3] `errs` ["Safe.Exact.zip3Exact","first list is shorter than the others"]@@ -105,6 +107,7 @@ may xs ys zs === Nothing f "zip3" zip3Exact zip3ExactMay zip3ExactNote f "zipWith3" (zipWith3Exact (,,)) (zipWith3ExactMay (,,)) (flip zipWith3ExactNote (,,))+ return True ---------------------------------------------------------------------@@ -146,9 +149,6 @@ instance Arbitrary a => Arbitrary (List10 a) where arbitrary = do i <- choose (0, 10); fmap List10 $ vector i--instance Testable () where- property () = property True instance Testable a => Testable (IO a) where property = property . unsafePerformIO
safe.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.18 build-type: Simple name: safe-version: 0.3.14+version: 0.3.15 license: BSD3 license-file: LICENSE category: Unclassified