Compare commits

..

No commits in common. "cc0c6bc1e98434bcce9f5692cf7442d964ddaf5d" and "b94133614f0d55ddd66d6a855a061bf691ae85f2" have entirely different histories.

3 changed files with 3 additions and 10 deletions

View File

@ -1,5 +1,5 @@
name: ris-utils
version: 0.0.2
version: 0.0.1
homepage: "https://git.fiskhamn.se/steffenomak/ris-utils#readme"
license: BSD3
author: "Stefan Risberg"

View File

@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack
name: ris-utils
version: 0.0.2
version: 0.0.1
description: Please see the README at <https://git.fiskhamn.se/steffenomak/ris-utils#readme>
homepage: https://git.fiskhamn.se/steffenomak/ris-utils#readme
author: Stefan Risberg

View File

@ -2,7 +2,6 @@ module Effects.Time (
currentTime,
currentTimeB,
currentTimeT,
benchFunction,
runTimeEff,
Time,
)
@ -20,7 +19,6 @@ data Time :: Effect where
CurrentTime :: Time m C.Time
CurrentTimeB :: Time m T.Builder
CurrentTimeT :: Time m Text
BenchFunction :: m a -> Time m (Timespan, a)
makeEffect ''Time
@ -28,7 +26,7 @@ runTimeEff ::
(IOE :> es) =>
Eff (Time : es) a ->
Eff es a
runTimeEff = interpret $ \env -> \case
runTimeEff = interpret $ \_ -> \case
CurrentTime -> liftIO now
CurrentTimeB ->
builder_YmdHMS (SubsecondPrecisionFixed 4) w3c . timeToDatetime
@ -36,8 +34,3 @@ runTimeEff = interpret $ \env -> \case
CurrentTimeT ->
encode_YmdHMS (SubsecondPrecisionFixed 4) w3c . timeToDatetime
<$> liftIO now
BenchFunction f -> do
s <- liftIO now
!d <- localSeqUnlift env $ \unlift -> unlift f
e <- liftIO now
pure (C.width $ s ... e, d)