aboutsummaryrefslogtreecommitdiff
path: root/hsm-core/Hsm/Core/Fsm.hs
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-01-16 19:22:18 -0800
committerPaul Oliver <contact@pauloliver.dev>2025-01-17 19:16:43 -0800
commite3ea039428545e185b38c5633fe3576ab32f1f8e (patch)
tree56ab8d1248b4387ceab6094305e7a75699c4e393 /hsm-core/Hsm/Core/Fsm.hs
parente1fa79eb713c249055fb23fcc6684a94f77d8368 (diff)
Cleans excessive type annotations
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