From 367aaf43ef9c52f454a721b1924808aeb2d7944f Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 23 Jan 2025 14:22:33 -0800 Subject: Replaces Int with Word type for numerical values --- hsm-dummy-pulser/Main.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'hsm-dummy-pulser') 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 -- cgit v1.2.1