io-classes-0.2.0.0: Type classes for concurrency with STM, ST and timing
Safe Haskell Safe-Inferred
Language Haskell2010

Control.Monad.Class.MonadTime

Synopsis

Documentation

class Monad m => MonadMonotonicTime m where Source #

Methods

getMonotonicTime :: m Time Source #

Time in a monotonic clock, with high precision. The epoch for this clock is arbitrary and does not correspond to any wall clock or calendar.

DiffTime and its action on Time

newtype Time Source #

A point in time in a monotonic clock.

The epoch for this clock is arbitrary and does not correspond to any wall clock or calendar, and is not guaranteed to be the same epoch across program runs. It is represented as the DiffTime from this arbitrary epoch.

Constructors

Time DiffTime

diffTime :: Time -> Time -> DiffTime Source #

The time duration between two points in time (positive or negative).

addTime :: DiffTime -> Time -> Time infixr 9 Source #

Add a duration to a point in time, giving another time.

data DiffTime Source #

This is a length of time, as measured by a clock. Conversion functions will treat it as seconds. It has a precision of 10^-12 s.

Instances

Instances details
Enum DiffTime
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Eq DiffTime
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Fractional DiffTime
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Data DiffTime
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> DiffTime -> c DiffTime Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c DiffTime Source #

toConstr :: DiffTime -> Constr Source #

dataTypeOf :: DiffTime -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c DiffTime ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c DiffTime ) Source #

gmapT :: ( forall b. Data b => b -> b) -> DiffTime -> DiffTime Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> DiffTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> DiffTime -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> DiffTime -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> DiffTime -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

Num DiffTime
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Ord DiffTime
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Real DiffTime
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

RealFrac DiffTime
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Show DiffTime
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

NFData DiffTime
Instance details

Defined in Data.Time.Clock.Internal.DiffTime

NominalTime and its action on UTCTime

data UTCTime Source #

This is the simplest representation of UTC. It consists of the day number, and a time offset from midnight. Note that if a day has a leap second added to it, it will have 86401 seconds.

Instances

Instances details
Eq UTCTime
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Data UTCTime
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> UTCTime -> c UTCTime Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c UTCTime Source #

toConstr :: UTCTime -> Constr Source #

dataTypeOf :: UTCTime -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c UTCTime ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c UTCTime ) Source #

gmapT :: ( forall b. Data b => b -> b) -> UTCTime -> UTCTime Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> UTCTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> UTCTime -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> UTCTime -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> UTCTime -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

Ord UTCTime
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

NFData UTCTime
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

data NominalDiffTime Source #

This is a length of time, as measured by UTC. It has a precision of 10^-12 s.

Conversion functions will treat it as seconds. For example, (0.010 :: NominalDiffTime) corresponds to 10 milliseconds.

It ignores leap-seconds, so it's not necessarily a fixed amount of clock time. For instance, 23:00 UTC + 2 hours of NominalDiffTime = 01:00 UTC (+ 1 day), regardless of whether a leap-second intervened.

Instances

Instances details
Enum NominalDiffTime
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Eq NominalDiffTime
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Fractional NominalDiffTime
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Data NominalDiffTime
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> NominalDiffTime -> c NominalDiffTime Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c NominalDiffTime Source #

toConstr :: NominalDiffTime -> Constr Source #

dataTypeOf :: NominalDiffTime -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c NominalDiffTime ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c NominalDiffTime ) Source #

gmapT :: ( forall b. Data b => b -> b) -> NominalDiffTime -> NominalDiffTime Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> NominalDiffTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> NominalDiffTime -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> NominalDiffTime -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> NominalDiffTime -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

Num NominalDiffTime
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Ord NominalDiffTime
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Real NominalDiffTime
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

RealFrac NominalDiffTime
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Show NominalDiffTime
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

NFData NominalDiffTime
Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime