Commits

Takayuki Muranushi committed f534b5d

arbitary instances for Values.

Comments (0)

Files changed (2)

src/UnitTyped/Type.hs

 import qualified Data.Vector.Unboxed as VU
 import qualified Data.Map as M
 import           GHC.Fingerprint (fingerprintString)
+import qualified Test.QuickCheck.Arbitrary as QC
 
 -- $setup
 -- >>> :l UnitTyped.NoPrelude
       fp = fingerprintString $ show tyCon
     in TypeRep fp tyCon []
 
+instance (QC.Arbitrary f) => QC.Arbitrary (Value a b f) where
+  arbitrary = fmap pure QC.arbitrary
+  shrink = traverse QC.shrink 
 
 -- |A wrapped value with scalar value 1.
 one :: (Fractional f, Convertible' a b) => Value a b f
   tag: 0.2
 
 library
-  build-depends:   base >= 4.6 && < 4.7, vector >= 0.10, time, old-locale, containers
+  build-depends:   base >= 4.6 && < 4.7, 
+                   containers,
+                   old-locale,
+                   QuickCheck >= 2,
+                   vector >= 0.10,
+                   time
+
+
   extensions:      FlexibleInstances
                    UndecidableInstances
                    FunctionalDependencies