@@ -387,7 +387,7 @@ class QCDProp state p | p -> state where
387387instance QCDProp state (QCDProperty state ) where
388388 qcdProperty = id
389389
390- instance Testable p => QCDProp state (Actions state -> p ) where
390+ instance ( StateModel state , Testable p ) => QCDProp state (Actions state -> p ) where
391391 qcdProperty p = QCDProperty (property . p) defaultOptions
392392
393393modifyOptions :: QCDProperty state -> (Options state -> Options state ) -> QCDProperty state
@@ -399,18 +399,16 @@ moreActions :: QCDProp state p => Rational -> p -> QCDProperty state
399399moreActions r p =
400400 modifyOptions (qcdProperty p) $ \ opts -> opts{actionLengthMultiplier = actionLengthMultiplier opts * r}
401401
402- -- NOTE: indexed on state for forwards compatibility, e.g. when we
403- -- want to give an explicit initial state
404- data Options state = Options { actionLengthMultiplier :: Rational }
402+ data Options state = Options { actionLengthMultiplier :: Rational , oInitialAnnotatedState :: Annotated state }
405403
406- defaultOptions :: Options state
407- defaultOptions = Options {actionLengthMultiplier = 1 }
404+ defaultOptions :: StateModel state => Options state
405+ defaultOptions = Options {actionLengthMultiplier = 1 , oInitialAnnotatedState = initialAnnotatedState }
408406
409407-- | Generate arbitrary actions with the `GenActionsOptions`. More flexible than using the type-based
410408-- modifiers.
411409generateActionsWithOptions :: forall state . StateModel state => Options state -> Gen (Actions state )
412410generateActionsWithOptions Options {.. } = do
413- (as, rejected) <- arbActions [] [] initialAnnotatedState 1
411+ (as, rejected) <- arbActions [] [] oInitialAnnotatedState 1
414412 return $ Actions_ rejected (Smart 0 as)
415413 where
416414 arbActions :: [Step state ] -> [String ] -> Annotated state -> Int -> Gen ([Step state ], [String ])
0 commit comments