ClassLaws 0.3.0.1 → 0.3.0.2
raw patch · 4 files changed
+18/−16 lines, 4 filesdep ~QuickCheckdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: QuickCheck, base
API changes (from Hackage documentation)
Files
- ClassLaws.cabal +7/−4
- src/Test/ClassLaws.hs +2/−2
- src/Test/ClassLaws/Partial.hs +1/−0
- src/Test/ClassLaws/TestingFinFuns.hs +8/−10
ClassLaws.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.3.0.1+version: 0.3.0.2 -- A short (one-line) description of the package. synopsis: Stating and checking laws for type class methods@@ -30,7 +30,10 @@ partially-defined values. Using partially-defined values, we show that the standard lazy and strict implementations of the state monad do not satisfy the expected laws. More information can be found at- http://wiki.portal.chalmers.se/cse/pmwiki.php/FP/ClassLaws+ <http://wiki.portal.chalmers.se/cse/pmwiki.php/FP/ClassLaws>. Built+ with ghc-7.4.2 and ghc-7.6.1. (Fails to build with ghc-7.2.2 due to+ http://hackage.haskell.org/trac/ghc/ticket/5745. Could be worked+ around.) -- The license under which the package is released. license: BSD3@@ -76,9 +79,9 @@ -- Other library packages from which modules are imported. build-depends: - base >=4.5 && < 5, + base >=4.1.0.0 && < 5, mtl >= 1 && < 3, - QuickCheck >= 2 && < 3, + QuickCheck >= 2 && < 2.5, ChasingBottoms >=1.3 && < 2 -- Directories containing source files.
src/Test/ClassLaws.hs view
@@ -4,10 +4,10 @@ -- MonadState classes live under their definitions in the hierarchy: -- Data.Monoid.Laws, Control.Monad.Laws, etc. module Test.ClassLaws ( module Test.ClassLaws.Core- , module Test.ClassLaws.Partial+ , module Test.ClassLaws.Partial , module Test.ClassLaws.TestingEquality , module Test.QuickCheck) where import Test.ClassLaws.Core import Test.ClassLaws.TestingEquality-import Test.ClassLaws.Partial+import Test.ClassLaws.Partial -- hiding (Result) import Test.QuickCheck
src/Test/ClassLaws/Partial.hs view
@@ -6,6 +6,7 @@ ( module Test.ClassLaws.Partial , module Test.ChasingBottoms ) where+-- A bug in ghc-7.2 complains about this part (re-export thinks Result still clashes) import Test.QuickCheck import Test.ChasingBottoms hiding (Result, listOf) -- clash with QuickCheck
src/Test/ClassLaws/TestingFinFuns.hs view
@@ -46,27 +46,25 @@ Gen a -> Gen (e -> a) arbitraryPartialFun ag = do funtab <- forM (bottom : enumElems :: [e]) (\_ -> ag)- genPartial 1 10 (return (table2fun funtab))+ genPartial 1 6 (return (table2fun funtab)) type FunTab e a = [a] -table2fun :: (Enum e, Bounded e, SemanticOrd a) => - FunTab e a -> (e -> a)+table2fun :: (Enum e, Bounded e, SemanticOrd a) => + FunTab e a -> (e -> a) table2fun tab@(_:tottab) = fun where meet = lMeet tab fun x | isBottom x = meet - | otherwise = tail tottab !! (fromEnum x)+ | otherwise = tottab !! (fromEnum x) lMeet :: (SemanticOrd a) => [a] -> a-lMeet [] = bottom-lMeet [x] = x-lMeet (x:xs) = x /\! lMeet xs+lMeet = foldr1 (/\!) ------------------------------------------------------------ -instance (Enum a, Bounded a, Show a, Show b) =>- Show (a->b) where- show = showFun+instance (Enum a, Bounded a, Show a, Show b) =>+ Show (a->b) where+ show = showFun instance ( Enum e, Bounded e, Eq e , SemanticOrd s, ArbitraryPartial s