File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
quickcheck-dynamic/src/Test/QuickCheck/StateModel Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ module Test.QuickCheck.StateModel.Variables (
1515 extendContext ,
1616 isWellTyped ,
1717 allVariables ,
18+ isEmptyCtx ,
1819 unsafeCoerceVar ,
1920 unsafeNextVarIndex ,
2021) where
@@ -105,8 +106,11 @@ instance Show VarContext where
105106 -- The use of typeRep here is on purpose to avoid printing `Var` unnecessarily.
106107 showBinding (Some v) = show v ++ " :: " ++ show (typeRep v)
107108
109+ isEmptyCtx :: VarContext -> Bool
110+ isEmptyCtx (VarCtx ctx) = null ctx
111+
108112isWellTyped :: Typeable a => Var a -> VarContext -> Bool
109- isWellTyped v (VarCtx ctx) = Some v `Set.member` ctx
113+ isWellTyped v (VarCtx ctx) = not ( null ctx) && Some v `Set.member` ctx
110114
111115-- TODO: check the invariant that no variable index is used
112116-- twice at different types. This is generally not an issue
You can’t perform that action at this time.
0 commit comments