polysemy-chronos 0.1.3.2 → 0.1.4.0
raw patch · 4 files changed
+38/−9 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Polysemy.Chronos: interpretTimeChronosConstant :: Member (Embed IO) r => Time -> InterpreterFor ChronosTime r
+ Polysemy.Chronos: interpretTimeChronosConstantNow :: Member (Embed IO) r => InterpreterFor ChronosTime r
+ Polysemy.Chronos.Time: interpretTimeChronosConstant :: Member (Embed IO) r => Time -> InterpreterFor ChronosTime r
+ Polysemy.Chronos.Time: interpretTimeChronosConstantNow :: Member (Embed IO) r => InterpreterFor ChronosTime r
Files
- changelog.md +5/−0
- lib/Polysemy/Chronos.hs +7/−1
- lib/Polysemy/Chronos/Time.hs +25/−7
- polysemy-chronos.cabal +1/−1
changelog.md view
@@ -1,2 +1,7 @@+# Unreleased++# 0.1.4.0+* Add interpreters that remain at a fixed instant+ # 0.1.0.0 * initial release
lib/Polysemy/Chronos.hs view
@@ -7,4 +7,10 @@ ) where import Polysemy.Chronos.Orphans ()-import Polysemy.Chronos.Time (ChronosTime, interpretTimeChronos, interpretTimeChronosAt)+import Polysemy.Chronos.Time (+ ChronosTime,+ interpretTimeChronos,+ interpretTimeChronosAt,+ interpretTimeChronosConstant,+ interpretTimeChronosConstantNow,+ )
lib/Polysemy/Chronos/Time.hs view
@@ -1,14 +1,14 @@ module Polysemy.Chronos.Time where import qualified Chronos as Chronos-import Chronos (Timespan(Timespan), dateToDay, dayToDate, dayToTimeMidnight, timeToDayTruncate)--import Polysemy.Chronos.Orphans ()-import Polysemy.Time.At (interpretTimeAt)+import Chronos (Timespan (Timespan), dateToDay, dayToDate, dayToTimeMidnight, timeToDayTruncate)+import Polysemy.Time.At (interceptTimeAt, interceptTimeConstant, interceptTimeConstantNow) import qualified Polysemy.Time.Data.Time as Core import Polysemy.Time.Data.Time (Time) import Polysemy.Time.Sleep (tSleep) +import Polysemy.Chronos.Orphans ()+ -- |Convenience alias for 'Chronos'. type ChronosTime = Time Chronos.Time Chronos.Date@@ -45,7 +45,7 @@ unit Core.SetDate _ -> unit-{-# INLINE interpretTimeChronos #-}+{-# inline interpretTimeChronos #-} -- |Interpret 'Time' with the types from 'Chronos', customizing the current time at the start of interpretation. interpretTimeChronosAt ::@@ -53,8 +53,26 @@ Chronos.Time -> InterpreterFor ChronosTime r interpretTimeChronosAt t =- interpretTimeChronos . interpretTimeAt @Timespan t-{-# INLINE interpretTimeChronosAt #-}+ interpretTimeChronos . interceptTimeAt @Timespan t+{-# inline interpretTimeChronosAt #-}++-- |Interpret 'Time' with the types from 'Chronos', customizing the current time to be constant.+interpretTimeChronosConstant ::+ Member (Embed IO) r =>+ Chronos.Time ->+ InterpreterFor ChronosTime r+interpretTimeChronosConstant t =+ interpretTimeChronos . interceptTimeConstant t+{-# inline interpretTimeChronosConstant #-}++-- |Interpret 'Time' with the types from 'Chronos', customizing the current time to be constantly the time at the+-- start of interpretation.+interpretTimeChronosConstantNow ::+ Member (Embed IO) r =>+ InterpreterFor ChronosTime r+interpretTimeChronosConstantNow =+ interpretTimeChronos . interceptTimeConstantNow @Chronos.Time+{-# inline interpretTimeChronosConstantNow #-} negateTimespan :: Timespan -> Timespan negateTimespan (Timespan t) =
polysemy-chronos.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: polysemy-chronos-version: 0.1.3.2+version: 0.1.4.0 synopsis: Polysemy-time Interpreters for Chronos description: Please see the readme on Github at <https://github.com/tek/polysemy-time> category: Time