hourglass-0.2.12: simple performant time related library
License BSD-style
Maintainer Vincent Hanquez <vincent@snarc.org>
Stability experimental
Portability unknown
Safe Haskell None
Language Haskell2010

Data.Hourglass.Epoch

Description

Epoch tracking

Synopsis

computer time tracking with various epoch

newtype ElapsedSince epoch Source #

A number of seconds elapsed since an epoch.

Instances

Instances details
Eq ( ElapsedSince epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Data epoch => Data ( ElapsedSince epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Methods

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

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

toConstr :: ElapsedSince epoch -> Constr Source #

dataTypeOf :: ElapsedSince epoch -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Num ( ElapsedSince epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Ord ( ElapsedSince epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Read ( ElapsedSince epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Show ( ElapsedSince epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

NFData ( ElapsedSince epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Methods

rnf :: ElapsedSince epoch -> () Source #

Epoch epoch => Time ( ElapsedSince epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Epoch epoch => Timeable ( ElapsedSince epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

data ElapsedSinceP epoch Source #

A number of seconds and nanoseconds elapsed since an epoch.

Instances

Instances details
Eq ( ElapsedSinceP epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Data epoch => Data ( ElapsedSinceP epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Methods

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

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

toConstr :: ElapsedSinceP epoch -> Constr Source #

dataTypeOf :: ElapsedSinceP epoch -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Num ( ElapsedSinceP e) Source #
Instance details

Defined in Data.Hourglass.Epoch

Ord ( ElapsedSinceP epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Read ( ElapsedSinceP epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Show ( ElapsedSinceP epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

NFData ( ElapsedSinceP e) Source #
Instance details

Defined in Data.Hourglass.Epoch

Epoch epoch => Time ( ElapsedSinceP epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Epoch epoch => Timeable ( ElapsedSinceP epoch) Source #
Instance details

Defined in Data.Hourglass.Epoch

Epoch

class Epoch epoch where Source #

epoch related.

We use the well known Unix epoch as the reference timezone for doing conversion between epochs.

Each methods of this typeclass should not use the actual value, but only get the information needed from the type itself.

Methods

epochName :: epoch -> String Source #

The name of this epoch

epochDiffToUnix :: epoch -> Seconds Source #

number of seconds of difference with 1st January 1970.

a negative number means that this epoch start before the unix epoch.

standard and usual epochs