freer-simple-time-0.1.0.0: freer-simple interface to IO based time functions

Copyright(c) Ben Weitzman 2018
LicenseMIT
Maintainerben@costarastrolgoy.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Control.Monad.Freer.Time

Description

 
Synopsis

Documentation

currentTime :: Member Time r => Eff r UTCTime Source #

Get the current time

data Time a Source #

The Time effect gives an interface to accessing the current time

runTime :: Member IO r => Eff (Time ': r) a -> Eff r a Source #

Use IO to handle getting the current time

runTimeAt :: UTCTime -> Eff (Time ': r) a -> Eff r a Source #

Use a given time that the program will consider "current"

runInstantaneously :: Member IO r => Eff (Time ': r) a -> Eff r a Source #

Use IO get the current time, but make the program think that everything is happening at the same instant. All calls to currentTime will return the same, present-ish UTCTime