aboutsummaryrefslogtreecommitdiff
path: root/hsm-dummy-pulser
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-01-23 14:22:33 -0800
committerPaul Oliver <contact@pauloliver.dev>2025-01-24 16:36:25 -0800
commit367aaf43ef9c52f454a721b1924808aeb2d7944f (patch)
treece166cf19d119510ba36f4b3c1fdcb9f2214c299 /hsm-dummy-pulser
parent85d856e87ad7875e5dfab19e22e71c4118f4cbad (diff)
Replaces Int with Word type for numerical values
Diffstat (limited to 'hsm-dummy-pulser')
-rw-r--r--hsm-dummy-pulser/Main.hs12
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