genvalidity-unordered-containers 0.3.0.1 → 1.0.0.0
raw patch · 8 files changed
+51/−66 lines, 8 filesdep ~genvaliditysetup-changedPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: genvalidity
API changes (from Hackage documentation)
- Data.GenValidity.HashMap: instance (Data.Hashable.Class.Hashable k, GHC.Classes.Eq k, Data.GenValidity.GenUnchecked k, Data.GenValidity.GenInvalid k, Data.GenValidity.GenUnchecked v, Data.GenValidity.GenInvalid v) => Data.GenValidity.GenInvalid (Data.HashMap.Base.HashMap k v)
- Data.GenValidity.HashMap: instance (Data.Hashable.Class.Hashable k, GHC.Classes.Eq k, Data.GenValidity.GenUnchecked k, Data.GenValidity.GenUnchecked v) => Data.GenValidity.GenUnchecked (Data.HashMap.Base.HashMap k v)
- Data.GenValidity.HashMap: instance (Data.Hashable.Class.Hashable k, GHC.Classes.Eq k, Data.GenValidity.GenValid k, Data.GenValidity.GenValid v) => Data.GenValidity.GenValid (Data.HashMap.Base.HashMap k v)
- Data.GenValidity.HashSet: instance (Data.Hashable.Class.Hashable v, GHC.Classes.Eq v, Data.GenValidity.GenUnchecked v) => Data.GenValidity.GenUnchecked (Data.HashSet.Base.HashSet v)
- Data.GenValidity.HashSet: instance (Data.Hashable.Class.Hashable v, GHC.Classes.Eq v, Data.GenValidity.GenUnchecked v, Data.GenValidity.GenInvalid v) => Data.GenValidity.GenInvalid (Data.HashSet.Base.HashSet v)
- Data.GenValidity.HashSet: instance (Data.Hashable.Class.Hashable v, GHC.Classes.Eq v, Data.GenValidity.GenValid v) => Data.GenValidity.GenValid (Data.HashSet.Base.HashSet v)
+ Data.GenValidity.HashMap: instance (Data.Hashable.Class.Hashable k, GHC.Classes.Eq k, Data.GenValidity.GenValid k, Data.GenValidity.GenValid v) => Data.GenValidity.GenValid (Data.HashMap.Internal.HashMap k v)
+ Data.GenValidity.HashSet: instance (Data.Hashable.Class.Hashable v, GHC.Classes.Eq v, Data.GenValidity.GenValid v) => Data.GenValidity.GenValid (Data.HashSet.Internal.HashSet v)
Files
- CHANGELOG.md +25/−0
- LICENSE +1/−1
- Setup.hs +0/−3
- genvalidity-unordered-containers.cabal +8/−7
- src/Data/GenValidity/HashMap.hs +5/−31
- src/Data/GenValidity/HashSet.hs +4/−16
- src/Data/GenValidity/UnorderedContainers.hs +3/−2
- test/Test/Validity/UnorderedContainersSpec.hs +5/−6
+ CHANGELOG.md view
@@ -0,0 +1,25 @@+# Changelog++## [1.0.0.0] - 2021-11-20++### Changed++* Compatibility with `genvalidity >= 1.0.0.0`++## [0.3.0.1] - 2020-02-10++### Changed++* Improved the cabal file++## [0.3.0.0] - 2019-03-06++### Changed++* Compatibility with genvalidity >=0.8++## [0.2.0.4] - 2018-11-07++### Changed++* Compatibility with validity >=0.9 and genvalidity >= 0.7
LICENSE view
@@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016-2020 Tom Sydney Kerckhove+Copyright (c) 2016-2021 Tom Sydney Kerckhove Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
− Setup.hs
@@ -1,3 +0,0 @@-import Distribution.Simple--main = defaultMain
genvalidity-unordered-containers.cabal view
@@ -1,23 +1,24 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.33.0.+-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack------ hash: 57a667015c4505ee795b36c3cfdf16b97df24ca29250cce43db4f9d8b4103dac name: genvalidity-unordered-containers-version: 0.3.0.1+version: 1.0.0.0 synopsis: GenValidity support for unordered-containers category: Testing homepage: https://github.com/NorfairKing/validity#readme bug-reports: https://github.com/NorfairKing/validity/issues author: Tom Sydney Kerckhove maintainer: syd@cs-syd.eu-copyright: Copyright: (c) 2017-2020 Tom Sydney Kerckhove+copyright: Copyright: (c) 2016-2021 Tom Sydney Kerckhove license: MIT license-file: LICENSE build-type: Simple+extra-source-files:+ LICENSE+ CHANGELOG.md source-repository head type: git@@ -35,7 +36,7 @@ build-depends: QuickCheck , base <5- , genvalidity >=0.8+ , genvalidity >=1.0 , hashable , unordered-containers , validity >=0.5@@ -53,7 +54,7 @@ ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall build-depends: base <5- , genvalidity >=0.7+ , genvalidity , genvalidity-hspec , genvalidity-unordered-containers , hspec
src/Data/GenValidity/HashMap.hs view
@@ -1,39 +1,13 @@ {-# OPTIONS_GHC -fno-warn-orphans #-}-{-# LANGUAGE CPP #-} module Data.GenValidity.HashMap where-#if !MIN_VERSION_base(4,8,0)-import Control.Applicative (pure)-import Data.Functor ((<$>))-#endif-import Data.GenValidity-import Data.Validity.HashMap ()-import Test.QuickCheck +import Data.GenValidity import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict as HM import Data.Hashable (Hashable)--instance (Hashable k, Eq k, GenUnchecked k, GenUnchecked v) =>- GenUnchecked (HashMap k v) where- genUnchecked = HM.fromList <$> genUnchecked- shrinkUnchecked = fmap HM.fromList . shrinkUnchecked . HM.toList--instance (Hashable k, Eq k, GenValid k, GenValid v) =>- GenValid (HashMap k v) where- genValid = HM.fromList <$> genValid- shrinkValid = fmap HM.fromList . shrinkValid . HM.toList+import Data.Validity.HashMap () -instance (Hashable k, Eq k, GenUnchecked k, GenInvalid k, GenUnchecked v, GenInvalid v) =>- GenInvalid (HashMap k v) where- genInvalid =- sized $ \n -> do- (k, v, m) <- genSplit3 n- let go g1 g2 = do- key <- resize k g1- val <- resize v g2- rest <- resize m genUnchecked- pure $ HM.insert key val rest- oneof [go genInvalid genUnchecked, go genUnchecked genInvalid]- -- Note: HM.fromList <$> genInvalid does not work because of this line in the Data.HashMap documentation:- -- 'If the list contains duplicate mappings, the later mappings take precedence.'+instance (Hashable k, Eq k, GenValid k, GenValid v) => GenValid (HashMap k v) where+ genValid = HM.fromList <$> genValid+ shrinkValid = fmap HM.fromList . shrinkValid . HM.toList
src/Data/GenValidity/HashSet.hs view
@@ -1,25 +1,13 @@ {-# OPTIONS_GHC -fno-warn-orphans #-}-{-# LANGUAGE CPP #-} module Data.GenValidity.HashSet where-#if !MIN_VERSION_base(4,8,0)-import Data.Functor ((<$>))-#endif-import Data.GenValidity-import Data.Validity.HashSet () +import Data.GenValidity import Data.HashSet (HashSet) import qualified Data.HashSet as HS import Data.Hashable (Hashable)--instance (Hashable v, Eq v, GenUnchecked v) => GenUnchecked (HashSet v) where- genUnchecked = HS.fromList <$> genUnchecked- shrinkUnchecked = fmap HS.fromList . shrinkUnchecked . HS.toList+import Data.Validity.HashSet () instance (Hashable v, Eq v, GenValid v) => GenValid (HashSet v) where- genValid = HS.fromList <$> genValid- shrinkValid = fmap HS.fromList . shrinkValid . HS.toList--instance (Hashable v, Eq v, GenUnchecked v, GenInvalid v) => GenInvalid (HashSet v) where- genInvalid = HS.fromList <$> genInvalid- shrinkInvalid = fmap HS.fromList . shrinkInvalid . HS.toList+ genValid = HS.fromList <$> genValid+ shrinkValid = fmap HS.fromList . shrinkValid . HS.toList
src/Data/GenValidity/UnorderedContainers.hs view
@@ -1,8 +1,9 @@ {-# OPTIONS_GHC -fno-warn-dodgy-exports #-} module Data.GenValidity.UnorderedContainers- ( module UnorderedContainers- ) where+ ( module UnorderedContainers,+ )+where import Data.GenValidity.HashMap as UnorderedContainers () import Data.GenValidity.HashSet as UnorderedContainers ()
test/Test/Validity/UnorderedContainersSpec.hs view
@@ -2,16 +2,15 @@ module Test.Validity.UnorderedContainersSpec where -import Test.Hspec- import Data.GenValidity.UnorderedContainers () import Data.HashMap.Strict (HashMap) import Data.HashSet (HashSet)+import Test.Hspec import Test.Validity.GenValidity spec :: Spec spec = do- genValidSpec @(HashSet Int)- genValiditySpec @(HashSet Rational)- genValidSpec @(HashMap Int Rational)- genValiditySpec @(HashMap Rational Rational)+ genValidSpec @(HashSet Int)+ genValidSpec @(HashSet Rational)+ genValidSpec @(HashMap Int Rational)+ genValidSpec @(HashMap Rational Rational)