diff options
Diffstat (limited to 'hsm-dummy-pulser/Main.hs')
-rw-r--r-- | hsm-dummy-pulser/Main.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/hsm-dummy-pulser/Main.hs b/hsm-dummy-pulser/Main.hs index cc16cd4..3e2a7ae 100644 --- a/hsm-dummy-pulser/Main.hs +++ b/hsm-dummy-pulser/Main.hs @@ -22,16 +22,16 @@ import System.IO.Echo (withoutInputEcho) data Env = Env { name :: Text , pubEp :: Text - , period :: Int - , pulses :: Int + , period :: Word + , pulses :: Word } $(deriveFromYaml ''Env) pulse :: (Concurrent :> es, Reader Env :> es) => Stream (Eff es) () -pulse = repeatM $ asks period >>= threadDelay +pulse = repeatM $ asks period >>= threadDelay . fromIntegral -stateRun :: F.FsmState () ByteString Env Int +stateRun :: F.FsmState () ByteString Env Word stateRun = F.FsmState "run" $ \_ env sta -> if sta < env.pulses @@ -47,9 +47,9 @@ stateRun = main :: IO () main = launch @Env "dummy-pulser" withoutInputEcho $ \env logger level -> - (pulse & F.fsm @_ @_ @Env @Int & send) + (pulse & F.fsm @_ @_ @Env @Word & send) & runServer @Env - & evalState @Int 1 + & evalState @Word 1 & evalState stateRun & runConcurrent & runLog env.name logger level |