@@ -449,17 +449,14 @@ commandGenOK (CommandA inputGen _ _ _) state =
449
449
-- evaluated.
450
450
--
451
451
data Action m (state :: (Type -> Type ) -> Type ) =
452
- forall input0 input output .
452
+ forall input output .
453
453
(TraversableB input , Show (input Symbolic ), Show output ) =>
454
454
Action {
455
- actionInput0 ::
456
- input0
457
-
458
- , actionInput ::
455
+ actionInput ::
459
456
input Symbolic
460
457
461
458
, actionRefreshInput ::
462
- state Symbolic -> input0 -> Maybe (input Symbolic )
459
+ state Symbolic -> Maybe (input Symbolic )
463
460
464
461
, actionOutput ::
465
462
Symbolic output
@@ -478,7 +475,7 @@ data Action m (state :: (Type -> Type) -> Type) =
478
475
}
479
476
480
477
instance Show (Action m state ) where
481
- showsPrec p (Action _ input _ (Symbolic (Name output)) _ _ _ _) =
478
+ showsPrec p (Action input _ (Symbolic (Name output)) _ _ _ _) =
482
479
showParen (p > 10 ) $
483
480
showString " Var " .
484
481
showsPrec 11 output .
@@ -561,10 +558,10 @@ contextNewVar = do
561
558
rethreadState :: [Action m state ] -> State (Context state ) [Action m state ]
562
559
rethreadState =
563
560
let
564
- loop (Action input0 _ refreshInput output exec require update ensure) = do
561
+ loop (Action _ refreshInput output exec require update ensure) = do
565
562
Context state0 vars0 <- get
566
563
567
- case refreshInput state0 input0 of
564
+ case refreshInput state0 of
568
565
Just input | require state0 input && variablesOK input vars0 -> do
569
566
let
570
567
state =
@@ -574,7 +571,7 @@ rethreadState =
574
571
insertSymbolic output vars0
575
572
576
573
put $ Context state vars
577
- pure $ Just $ Action input0 input refreshInput output exec require update ensure
574
+ pure $ Just $ Action input refreshInput output exec require update ensure
578
575
_ ->
579
576
pure Nothing
580
577
in
@@ -615,7 +612,7 @@ action commands =
615
612
callbackUpdate callbacks state0 input (Var output)
616
613
617
614
pure . Just $
618
- Action input input (const Just ) output exec
615
+ Action input (const $ Just input ) output exec
619
616
(callbackRequire callbacks)
620
617
(callbackUpdate callbacks)
621
618
(callbackEnsure callbacks)
@@ -634,7 +631,7 @@ action commands =
634
631
callbackUpdate callbacks state0 input (Var output)
635
632
636
633
pure . Just $
637
- Action input0 input mkInput output exec
634
+ Action input ( flip mkInput input0) output exec
638
635
(callbackRequire callbacks)
639
636
(callbackUpdate callbacks)
640
637
(callbackEnsure callbacks)
@@ -661,7 +658,7 @@ newtype Sequential m state =
661
658
}
662
659
663
660
renderAction :: Action m state -> [String ]
664
- renderAction (Action _ input _ (Symbolic (Name output)) _ _ _ _) =
661
+ renderAction (Action input _ (Symbolic (Name output)) _ _ _ _) =
665
662
let
666
663
prefix0 =
667
664
" Var " ++ show output ++ " = "
@@ -677,7 +674,7 @@ renderAction (Action _ input _ (Symbolic (Name output)) _ _ _ _) =
677
674
fmap (prefix ++ ) xs
678
675
679
676
renderActionResult :: Environment -> Action m state -> [String ]
680
- renderActionResult env (Action _ _ _ output@ (Symbolic (Name name)) _ _ _ _) =
677
+ renderActionResult env (Action _ _ output@ (Symbolic (Name name)) _ _ _ _) =
681
678
let
682
679
prefix0 =
683
680
" Var " ++ show name ++ " = "
@@ -776,7 +773,7 @@ data ActionCheck state =
776
773
}
777
774
778
775
execute :: (MonadTest m , HasCallStack ) => Action m state -> StateT Environment m (ActionCheck state )
779
- execute (Action _ sinput _ soutput exec _require update ensure) =
776
+ execute (Action sinput _ soutput exec _require update ensure) =
780
777
withFrozenCallStack $ do
781
778
env0 <- get
782
779
input <- evalEither $ reify env0 sinput
@@ -803,7 +800,7 @@ executeUpdateEnsure ::
803
800
=> (state Concrete , Environment )
804
801
-> Action m state
805
802
-> m (state Concrete , Environment )
806
- executeUpdateEnsure (state0, env0) (Action _ sinput _ soutput exec _require update ensure) =
803
+ executeUpdateEnsure (state0, env0) (Action sinput _ soutput exec _require update ensure) =
807
804
withFrozenCallStack $ do
808
805
input <- evalEither $ reify env0 sinput
809
806
output <- exec input
0 commit comments