registry-hedgehog 0.7.0.3 → 0.7.0.4
raw patch · 2 files changed
+9/−2 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Data.Registry.Hedgehog: setOfMinMax :: forall a. Ord a => Int -> Int -> Gen a -> Gen (Set a)
- Test.Tasty.Hedgehogx: Command :: (state Symbolic -> Maybe (gen (input Symbolic))) -> (input Concrete -> m output) -> [Callback input output state] -> Command (gen :: Type -> Type) (m :: Type -> Type) (state :: (Type -> Type) -> Type)
+ Test.Tasty.Hedgehogx: Command :: (state Symbolic -> Maybe (gen (input Symbolic))) -> (input Concrete -> m output) -> [Callback input output state] -> Command (gen :: Type -> Type) (m :: TYPE LiftedRep -> Type) (state :: (Type -> Type) -> Type)
- Test.Tasty.Hedgehogx: Parallel :: [Action m state] -> [Action m state] -> [Action m state] -> Parallel (m :: Type -> Type) (state :: (Type -> Type) -> Type)
+ Test.Tasty.Hedgehogx: Parallel :: [Action m state] -> [Action m state] -> [Action m state] -> Parallel (m :: TYPE LiftedRep -> Type) (state :: (Type -> Type) -> Type)
- Test.Tasty.Hedgehogx: Sequential :: [Action m state] -> Sequential (m :: Type -> Type) (state :: (Type -> Type) -> Type)
+ Test.Tasty.Hedgehogx: Sequential :: [Action m state] -> Sequential (m :: TYPE LiftedRep -> Type) (state :: (Type -> Type) -> Type)
- Test.Tasty.Hedgehogx: [commandCallbacks] :: Command (gen :: Type -> Type) (m :: Type -> Type) (state :: (Type -> Type) -> Type) -> [Callback input output state]
+ Test.Tasty.Hedgehogx: [commandCallbacks] :: Command (gen :: Type -> Type) (m :: TYPE LiftedRep -> Type) (state :: (Type -> Type) -> Type) -> [Callback input output state]
- Test.Tasty.Hedgehogx: [commandExecute] :: Command (gen :: Type -> Type) (m :: Type -> Type) (state :: (Type -> Type) -> Type) -> input Concrete -> m output
+ Test.Tasty.Hedgehogx: [commandExecute] :: Command (gen :: Type -> Type) (m :: TYPE LiftedRep -> Type) (state :: (Type -> Type) -> Type) -> input Concrete -> m output
- Test.Tasty.Hedgehogx: [commandGen] :: Command (gen :: Type -> Type) (m :: Type -> Type) (state :: (Type -> Type) -> Type) -> state Symbolic -> Maybe (gen (input Symbolic))
+ Test.Tasty.Hedgehogx: [commandGen] :: Command (gen :: Type -> Type) (m :: TYPE LiftedRep -> Type) (state :: (Type -> Type) -> Type) -> state Symbolic -> Maybe (gen (input Symbolic))
- Test.Tasty.Hedgehogx: [parallelBranch1] :: Parallel (m :: Type -> Type) (state :: (Type -> Type) -> Type) -> [Action m state]
+ Test.Tasty.Hedgehogx: [parallelBranch1] :: Parallel (m :: TYPE LiftedRep -> Type) (state :: (Type -> Type) -> Type) -> [Action m state]
- Test.Tasty.Hedgehogx: [parallelBranch2] :: Parallel (m :: Type -> Type) (state :: (Type -> Type) -> Type) -> [Action m state]
+ Test.Tasty.Hedgehogx: [parallelBranch2] :: Parallel (m :: TYPE LiftedRep -> Type) (state :: (Type -> Type) -> Type) -> [Action m state]
- Test.Tasty.Hedgehogx: [parallelPrefix] :: Parallel (m :: Type -> Type) (state :: (Type -> Type) -> Type) -> [Action m state]
+ Test.Tasty.Hedgehogx: [parallelPrefix] :: Parallel (m :: TYPE LiftedRep -> Type) (state :: (Type -> Type) -> Type) -> [Action m state]
- Test.Tasty.Hedgehogx: [sequentialActions] :: Sequential (m :: Type -> Type) (state :: (Type -> Type) -> Type) -> [Action m state]
+ Test.Tasty.Hedgehogx: [sequentialActions] :: Sequential (m :: TYPE LiftedRep -> Type) (state :: (Type -> Type) -> Type) -> [Action m state]
- Test.Tasty.Hedgehogx: class HTraversable (t :: Type -> Type -> Type)
+ Test.Tasty.Hedgehogx: class HTraversable (t :: Type -> TYPE LiftedRep -> TYPE LiftedRep)
- Test.Tasty.Hedgehogx: class Show1 (f :: Type -> Type)
+ Test.Tasty.Hedgehogx: class Show1 (f :: TYPE LiftedRep -> TYPE LiftedRep)
- Test.Tasty.Hedgehogx: data Action (m :: Type -> Type) (state :: Type -> Type -> Type)
+ Test.Tasty.Hedgehogx: data Action (m :: TYPE LiftedRep -> Type) (state :: Type -> Type -> Type)
- Test.Tasty.Hedgehogx: data Command (gen :: Type -> Type) (m :: Type -> Type) (state :: Type -> Type -> Type)
+ Test.Tasty.Hedgehogx: data Command (gen :: Type -> Type) (m :: TYPE LiftedRep -> Type) (state :: Type -> Type -> Type)
- Test.Tasty.Hedgehogx: data Parallel (m :: Type -> Type) (state :: Type -> Type -> Type)
+ Test.Tasty.Hedgehogx: data Parallel (m :: TYPE LiftedRep -> Type) (state :: Type -> Type -> Type)
- Test.Tasty.Hedgehogx: newtype Sequential (m :: Type -> Type) (state :: Type -> Type -> Type)
+ Test.Tasty.Hedgehogx: newtype Sequential (m :: TYPE LiftedRep -> Type) (state :: Type -> Type -> Type)
Files
registry-hedgehog.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: bdeac6f56c70c9617ee3d3697e2cd995e8450cfe1704fd0cecebbb22cf008e3a+-- hash: 8da4d7249d8800f06d303acbc3ed33c9d559db7bfde2ba78d8a2cf4293c4d2d0 name: registry-hedgehog-version: 0.7.0.3+version: 0.7.0.4 synopsis: utilities to work with Hedgehog generators and `registry` description: This library provides some functions to extract generators from a "Registry" and make stateful modifications of that Registry to precisely control the generation of data category: Control
src/Data/Registry/Hedgehog.hs view
@@ -42,6 +42,7 @@ nonEmptyOf, pairOf, setOf,+ setOfMinMax, tripleOf, tuple4Of, tuple5Of,@@ -54,6 +55,7 @@ where import Data.HashMap.Strict as HashMap (HashMap, fromList)+import qualified Data.List as L import Data.List.NonEmpty as NonEmpty hiding (cycle, nonEmpty, (!!)) import Data.Map as Map (fromList) import Data.Maybe as Maybe@@ -198,6 +200,11 @@ -- | Create a default generator for a small set of elements setOf :: forall a. (Ord a) => Gen a -> Gen (Set a) setOf = fmap Set.fromList . listOf++-- | Create a default generator for a set with a minimum and a maximum number of elements+-- The implementation uses Gen.filter to make sure that the elements are unique+setOfMinMax :: forall a. (Ord a) => Int -> Int -> Gen a -> Gen (Set a)+setOfMinMax mi mx = fmap Set.fromList . Gen.filter (\as -> L.nub as == as) . listOfMinMax @a mi mx -- | Create a default generator for map of key/values mapOf :: forall k v. (Ord k) => Gen k -> Gen v -> Gen (Map k v)