Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions qc-tests/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import Test.SmartCheck.Types

--------------------------------------------------------------------------------

deriving instance Generic a => Generic (Tree a)
instance (SubTypes a, Generic a) => SubTypes (Tree a)
deriving instance Generic (Tree a)
instance (SubTypes a) => SubTypes (Tree a)

instance Q.Arbitrary a => Q.Arbitrary (Tree a) where
arbitrary = Q.sized mkT
Expand Down
28 changes: 24 additions & 4 deletions src/Test/SmartCheck/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,30 @@ instance (Show a, Q.Arbitrary a, SubTypes a, Typeable a) => GST (K1 i a) where
-- http://hackage.haskell.org/packages/archive/QuickCheck/2.4.2/doc/html/Test-QuickCheck-Arbitrary.html

instance SubTypes Bool where baseType _ = True
instance SubTypes Char where baseType _ = True
instance SubTypes Double where baseType _ = True
instance SubTypes Float where baseType _ = True
instance SubTypes Int where baseType _ = True
instance SubTypes Char where
subTypes _ = []
baseType _ = True
replaceChild = replaceChild'
toConstr = toConstr'
showForest = showForest'
instance SubTypes Double where
subTypes _ = []
baseType _ = True
replaceChild = replaceChild'
toConstr = toConstr'
showForest = showForest'
instance SubTypes Float where
subTypes _ = []
baseType _ = True
replaceChild = replaceChild'
toConstr = toConstr'
showForest = showForest'
instance SubTypes Int where
subTypes _ = []
baseType _ = True
replaceChild = replaceChild'
toConstr = toConstr'
showForest = showForest'
instance SubTypes Integer where
subTypes _ = []
baseType _ = True
Expand Down