Skip to content

Commit 54b4cf8

Browse files
Add instance of HasVariables for Any f. (#56)
1 parent 17a7030 commit 54b4cf8

File tree

1 file changed

+4
-0
lines changed
  • quickcheck-dynamic/src/Test/QuickCheck/StateModel

1 file changed

+4
-0
lines changed

quickcheck-dynamic/src/Test/QuickCheck/StateModel/Variables.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE AllowAmbiguousTypes #-}
2+
{-# LANGUAGE QuantifiedConstraints #-}
23
{-# LANGUAGE UndecidableInstances #-}
34

45
module Test.QuickCheck.StateModel.Variables (
@@ -58,6 +59,9 @@ instance (HasVariables k, HasVariables v) => HasVariables (Map k v) where
5859
instance HasVariables a => HasVariables (Set a) where
5960
getAllVariables = getAllVariables . Set.toList
6061

62+
instance (forall a. HasVariables (f a)) => HasVariables (Any f) where
63+
getAllVariables (Some a) = getAllVariables a
64+
6165
newtype HasNoVariables a = HasNoVariables a
6266

6367
deriving via a instance Show a => Show (HasNoVariables a)

0 commit comments

Comments
 (0)