o-clock-0.0.0: Type-safe time library.

Safe HaskellNone
LanguageHaskell2010

Time.TimeStamp

Description

This module introduces TimeStamp data type and corresponding functions for operations with time.

Synopsis

Documentation

newtype TimeStamp Source #

Similar to Time but has no units and can be negative.

Constructors

TimeStamp Rational 

Instances

Enum TimeStamp Source # 
Eq TimeStamp Source # 
Fractional TimeStamp Source # 
Num TimeStamp Source # 
Ord TimeStamp Source # 
Read TimeStamp Source # 
Real TimeStamp Source # 
RealFrac TimeStamp Source # 
Show TimeStamp Source # 

timeDiff :: forall (unit :: Rat). KnownRat unit => TimeStamp -> TimeStamp -> (Ordering, Time unit) Source #

Returns the result of comparison of two Timestamps and the Time of that difference of given time unit.

timeAdd :: forall (unit :: Rat). KnownRat unit => Time unit -> Time unit -> Time unit Source #

Returns the result of addition of two Time elements.

timeMul :: forall (unit :: Rat). KnownRat unit => RatioNat -> Time unit -> Time unit Source #

Returns the result of multiplication of two Time elements.

timeDiv :: forall (unit :: Rat). KnownRat unit => Time unit -> Time unit -> RatioNat Source #

Returns the result of division of two Time elements.