test-invariant 0.4.0.0 → 0.4.1.0
raw patch · 2 files changed
+18/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Test.Invariant: (<~~) :: Eq b => (a -> b) -> (a -> a) -> a -> Bool
+ Test.Invariant: (@~>) :: Eq a => (b -> a) -> (a -> b) -> a -> Bool
Files
- src/Test/Invariant.hs +17/−0
- test-invariant.cabal +1/−1
src/Test/Invariant.hs view
@@ -3,6 +3,7 @@ import Test.QuickCheck infix 1 <=>, &>+infix 2 <~~, @~> -- | Defines extensional equality. This allows concise, point-free, -- definitions of laws. For example idempotence:@@ -186,3 +187,19 @@ -- +++ OK, passed 100 tests. invariatesOver :: Eq b => (a -> b) -> (a -> a) -> a -> Bool f `invariatesOver` g = f . g <=> f++-- | Checks whether a function is invariant over an other function.+--+-- >>> quickCheck $ length <~~ reverse+-- +++ OK, passed 100 tests.+(<~~) :: Eq b => (a -> b) -> (a -> a) -> a -> Bool+f <~~ g = f . g <=> f++-- | Checks whether a function is the inverse of another function.+--+-- > f(g(x)) = x+--+-- >>> quickCheck $ (`div` 2) @~> (*2)+-- +++ OK, passed 100 tests.+(@~>) :: Eq a => (b -> a) -> (a -> b) -> a -> Bool+f @~> g = f . g <=> id
test-invariant.cabal view
@@ -1,5 +1,5 @@ name: test-invariant-version: 0.4.0.0+version: 0.4.1.0 synopsis: Provide common invariants to be checked with QuickCheck description: test-invariant is a library for providing common invariants of