packages feed

effectful-cli 0.2.9.3 → 0.2.10.0

raw patch · 3 files changed

+22/−2 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Effectful.CLI.Sleep: sleepFor :: forall (es :: [Effect]). (IOE :> es, Logger :> es) => NominalDiffTime -> Eff es ()

Files

CHANGELOG.md view
@@ -1,3 +1,9 @@+## [2.10.0](https://github.com/haskell-github-trust/effectful-cli/compare/2.9.3...2.10.0) (2026-11-17)++### Features++* add `sleepFor` timedelta-based util ([6ad6747](https://github.com/haskell-github-trust/effectful-cli/commit/6ad67475396303e3f38ea3eb1ebe8160966e365e))+ ## [2.9.3](https://github.com/haskell-github-trust/effectful-cli/compare/2.9.2...2.9.3) (2026-11-16)  ### Bug Fixes
effectful-cli.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           effectful-cli-version:        0.2.9.3+version:        0.2.10.0 synopsis:       CLI helpers for the effectful ecosystem description:    Please see the README at https://github.com/haskell-github-trust/effectful-cli category:       CLI
src/Effectful/CLI/Sleep.hs view
@@ -2,6 +2,7 @@ module Effectful.CLI.Sleep (   msleep,   sleep,+  sleepFor,   sleepUntil, ) where @@ -10,6 +11,7 @@ import Data.Text qualified as T import Data.Time (   LocalTime,+  NominalDiffTime,   defaultTimeLocale,   diffLocalTime,   formatTime,@@ -58,4 +60,16 @@ sleepUntil t = do   logInfoN (T.pack ("sleeping until " <> formatTime defaultTimeLocale "%R" t))   now <- getLocalTime-  sleep . ceiling . nominalDiffTimeToSeconds $ diffLocalTime t now+  sleepFor (diffLocalTime t now)++-- | Sleep for the given duration.+--+-- @since 0.2.10.0+sleepFor+  :: IOE :> es+  => Logger :> es+  => NominalDiffTime+  -> Eff es ()+sleepFor d = do+  logDebugN (T.pack ("sleeping for " <> show d))+  liftIO (threadDelay (max 0 (ceiling (nominalDiffTimeToSeconds d * 1000000))))