aboutsummaryrefslogtreecommitdiff
path: root/hsm-core/Hsm/Core/Fsm.hs
diff options
context:
space:
mode:
Diffstat (limited to 'hsm-core/Hsm/Core/Fsm.hs')
-rw-r--r--hsm-core/Hsm/Core/Fsm.hs9
1 files changed, 2 insertions, 7 deletions
diff --git a/hsm-core/Hsm/Core/Fsm.hs b/hsm-core/Hsm/Core/Fsm.hs
index 6f9910e..d1c2f5d 100644
--- a/hsm-core/Hsm/Core/Fsm.hs
+++ b/hsm-core/Hsm/Core/Fsm.hs
@@ -39,23 +39,18 @@ fsm ::
-> S.Stream (Eff es) o
fsm = S.mapM (return . fromJust) . S.takeWhile isJust . S.mapM run
where
- exit :: Eff es (Maybe o)
exit = do
logAttention_ "No state returned, exiting FSM"
return Nothing
- --
- push :: FsmResult i o env sta -> Eff es (Maybe o)
push (FsmResult out sta next) = do
put sta
put next
return $ Just out
- --
- run :: i -> Eff es (Maybe o)
run input =
localDomain "fsm" $ do
FsmState name action <- get
- sta <- get
- env <- ask
+ sta <- get @sta
+ env <- ask @env
logTrace_ $ "Entering state " <> name
FsmOutput res logs <- return $ action input env sta
localDomain name $ mapM_ logTup logs