packages feed

genvalidity-uuid 0.1.0.3 → 0.1.0.4

raw patch · 3 files changed

+48/−3 lines, 3 filesdep +criteriondep +genvalidity-criteriondep ~basedep ~genvalidityPVP ok

version bump matches the API change (PVP)

Dependencies added: criterion, genvalidity-criterion

Dependency ranges changed: base, genvalidity

API changes (from Hackage documentation)

Files

+ bench/Main.hs view
@@ -0,0 +1,20 @@+{-# LANGUAGE AllowAmbiguousTypes #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TypeApplications #-}++module Main where++import Criterion.Main as Criterion+import Data.GenValidity+import Data.GenValidity.Criterion+import Data.GenValidity.UUID ()+import Data.UUID+import Test.QuickCheck++main :: IO ()+main =+  Criterion.defaultMain+    [ genValidBench @UUID,+      genUncheckedBench @UUID,+      genBench "valid UUID via genUnchecked" ((genUnchecked `suchThat` isValid) :: Gen UUID)+    ]
genvalidity-uuid.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: acc801e8b1f6aca3c589d815de1c651c40506f464bdae9be9089ff0e59ae8a93+-- hash: fc85c45732a67308227ab1b3a08dd68797f21a09df65fe651368d18b8ff6c72e  name:           genvalidity-uuid-version:        0.1.0.3+version:        0.1.0.4 synopsis:       GenValidity support for UUID category:       Testing homepage:       https://github.com/NorfairKing/validity#readme@@ -55,5 +55,23 @@     , genvalidity-hspec     , genvalidity-uuid     , hspec+    , uuid+  default-language: Haskell2010++benchmark genvalidity-uuid-bench+  type: exitcode-stdio-1.0+  main-is: Main.hs+  other-modules:+      Paths_genvalidity_uuid+  hs-source-dirs:+      bench/+  ghc-options: -Wall+  build-depends:+      QuickCheck+    , base >=4.7 && <5+    , criterion+    , genvalidity+    , genvalidity-criterion+    , genvalidity-uuid     , uuid   default-language: Haskell2010
src/Data/GenValidity/UUID.hs view
@@ -19,4 +19,11 @@         | (w1, w2, w3, w4) <- shrinkUnchecked $ toWords u         ] -instance GenValid UUID+instance GenValid UUID where+    genValid =+        fromWords <$> genValid <*> genValid <*> genValid <*>+        genValid+    shrinkValid u =+        [ fromWords w1 w2 w3 w4+        | (w1, w2, w3, w4) <- shrinkValid $ toWords u+        ]