diff options
Diffstat (limited to 'hsm-core/Hsm/Core')
-rw-r--r-- | hsm-core/Hsm/Core/Fsm.hs | 2 | ||||
-rw-r--r-- | hsm-core/Hsm/Core/Log.hs | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/hsm-core/Hsm/Core/Fsm.hs b/hsm-core/Hsm/Core/Fsm.hs index 43fa497..6f9910e 100644 --- a/hsm-core/Hsm/Core/Fsm.hs +++ b/hsm-core/Hsm/Core/Fsm.hs @@ -26,6 +26,8 @@ data FsmOutput i o env sta = data FsmResult i o env sta = FsmResult o sta (FsmState i o env sta) +-- Finite state machines allow processing of stream elements using pure +-- functions. One or more FSMs can be included within a `Streamly` pipeline. fsm :: forall i o env sta es. ( Log :> es diff --git a/hsm-core/Hsm/Core/Log.hs b/hsm-core/Hsm/Core/Log.hs index 9f1f357..9bf8b37 100644 --- a/hsm-core/Hsm/Core/Log.hs +++ b/hsm-core/Hsm/Core/Log.hs @@ -9,6 +9,8 @@ import Data.Time.Clock (getCurrentTime) import Effectful (Eff, (:>)) import Effectful.Log (Log, LogLevel, getLoggerIO, logMessage) +-- Helper function allows logging within IO, Useful during `resourcet` +-- allocation and release operations. withLogIO :: Log :> es => Eff es (LogLevel -> Text -> IO ()) withLogIO = do logIO <- getLoggerIO |