polysemy-time-0.2.0.3: Polysemy Effect for Time
Safe HaskellNone
LanguageHaskell2010

Polysemy.Time.Data.TimeUnit

Description

TimeUnit Class and Data Types, Internal

Synopsis

Documentation

newtype FromSeconds a Source #

For deriving via.

Constructors

FromSeconds a 

Instances

Instances details
Eq a => Eq (FromSeconds a) Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

(Integral a, TimeUnit a) => Fractional (FromSeconds a) Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Num a => Num (FromSeconds a) Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Show a => Show (FromSeconds a) Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

class TimeUnit u where Source #

Types that represent an amount of time that can be converted to each other. The methods are internal, the API function is convert.

Minimal complete definition

nanos

Instances

Instances details
TimeUnit NominalDiffTime Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit DiffTime Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Data types used to specify time spans, e.g. for sleeping.

newtype Years Source #

Years.

Constructors

Years 

Fields

Instances

Instances details
Enum Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Eq Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

(==) :: Years -> Years -> Bool #

(/=) :: Years -> Years -> Bool #

Integral Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Num Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Ord Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

compare :: Years -> Years -> Ordering #

(<) :: Years -> Years -> Bool #

(<=) :: Years -> Years -> Bool #

(>) :: Years -> Years -> Bool #

(>=) :: Years -> Years -> Bool #

max :: Years -> Years -> Years #

min :: Years -> Years -> Years #

Real Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

toRational :: Years -> Rational #

Show Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

showsPrec :: Int -> Years -> ShowS #

show :: Years -> String #

showList :: [Years] -> ShowS #

Generic Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Associated Types

type Rep Years :: Type -> Type #

Methods

from :: Years -> Rep Years x #

to :: Rep Years x -> Years #

ToJSON Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

FromJSON Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Additive Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

zero :: Years #

invert :: Years -> Years #

plus :: Years -> Years -> Years #

minus :: Years -> Years -> Years #

type Rep Years Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Years = D1 ('MetaData "Years" "Polysemy.Time.Data.TimeUnit" "polysemy-time-0.2.0.3-inplace" 'True) (C1 ('MetaCons "Years" 'PrefixI 'True) (S1 ('MetaSel ('Just "unYear") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

newtype Months Source #

Months.

Constructors

Months 

Fields

Instances

Instances details
Enum Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Eq Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

(==) :: Months -> Months -> Bool #

(/=) :: Months -> Months -> Bool #

Integral Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Num Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Ord Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Real Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Show Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Generic Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Associated Types

type Rep Months :: Type -> Type #

Methods

from :: Months -> Rep Months x #

to :: Rep Months x -> Months #

ToJSON Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

FromJSON Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Additive Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Months Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Months = D1 ('MetaData "Months" "Polysemy.Time.Data.TimeUnit" "polysemy-time-0.2.0.3-inplace" 'True) (C1 ('MetaCons "Months" 'PrefixI 'True) (S1 ('MetaSel ('Just "unMonths") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

newtype Weeks Source #

Weeks.

Constructors

Weeks 

Fields

Instances

Instances details
Enum Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Eq Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

(==) :: Weeks -> Weeks -> Bool #

(/=) :: Weeks -> Weeks -> Bool #

Integral Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Num Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Ord Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

compare :: Weeks -> Weeks -> Ordering #

(<) :: Weeks -> Weeks -> Bool #

(<=) :: Weeks -> Weeks -> Bool #

(>) :: Weeks -> Weeks -> Bool #

(>=) :: Weeks -> Weeks -> Bool #

max :: Weeks -> Weeks -> Weeks #

min :: Weeks -> Weeks -> Weeks #

Real Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

toRational :: Weeks -> Rational #

Show Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

showsPrec :: Int -> Weeks -> ShowS #

show :: Weeks -> String #

showList :: [Weeks] -> ShowS #

Generic Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Associated Types

type Rep Weeks :: Type -> Type #

Methods

from :: Weeks -> Rep Weeks x #

to :: Rep Weeks x -> Weeks #

ToJSON Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

FromJSON Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Additive Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

zero :: Weeks #

invert :: Weeks -> Weeks #

plus :: Weeks -> Weeks -> Weeks #

minus :: Weeks -> Weeks -> Weeks #

TimeUnit Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Weeks Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Weeks = D1 ('MetaData "Weeks" "Polysemy.Time.Data.TimeUnit" "polysemy-time-0.2.0.3-inplace" 'True) (C1 ('MetaCons "Weeks" 'PrefixI 'True) (S1 ('MetaSel ('Just "unWeeks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

newtype Days Source #

Days.

Constructors

Days 

Fields

Instances

Instances details
Enum Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

succ :: Days -> Days #

pred :: Days -> Days #

toEnum :: Int -> Days #

fromEnum :: Days -> Int #

enumFrom :: Days -> [Days] #

enumFromThen :: Days -> Days -> [Days] #

enumFromTo :: Days -> Days -> [Days] #

enumFromThenTo :: Days -> Days -> Days -> [Days] #

Eq Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

(==) :: Days -> Days -> Bool #

(/=) :: Days -> Days -> Bool #

Integral Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

quot :: Days -> Days -> Days #

rem :: Days -> Days -> Days #

div :: Days -> Days -> Days #

mod :: Days -> Days -> Days #

quotRem :: Days -> Days -> (Days, Days) #

divMod :: Days -> Days -> (Days, Days) #

toInteger :: Days -> Integer #

Num Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

(+) :: Days -> Days -> Days #

(-) :: Days -> Days -> Days #

(*) :: Days -> Days -> Days #

negate :: Days -> Days #

abs :: Days -> Days #

signum :: Days -> Days #

fromInteger :: Integer -> Days #

Ord Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

compare :: Days -> Days -> Ordering #

(<) :: Days -> Days -> Bool #

(<=) :: Days -> Days -> Bool #

(>) :: Days -> Days -> Bool #

(>=) :: Days -> Days -> Bool #

max :: Days -> Days -> Days #

min :: Days -> Days -> Days #

Real Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

toRational :: Days -> Rational #

Show Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

showsPrec :: Int -> Days -> ShowS #

show :: Days -> String #

showList :: [Days] -> ShowS #

Generic Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Associated Types

type Rep Days :: Type -> Type #

Methods

from :: Days -> Rep Days x #

to :: Rep Days x -> Days #

ToJSON Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

FromJSON Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Additive Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

zero :: Days #

invert :: Days -> Days #

plus :: Days -> Days -> Days #

minus :: Days -> Days -> Days #

TimeUnit Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Days Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Days = D1 ('MetaData "Days" "Polysemy.Time.Data.TimeUnit" "polysemy-time-0.2.0.3-inplace" 'True) (C1 ('MetaCons "Days" 'PrefixI 'True) (S1 ('MetaSel ('Just "unDays") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

newtype Hours Source #

Hours.

Constructors

Hours 

Fields

Instances

Instances details
Enum Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Eq Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

(==) :: Hours -> Hours -> Bool #

(/=) :: Hours -> Hours -> Bool #

Integral Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Num Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Ord Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

compare :: Hours -> Hours -> Ordering #

(<) :: Hours -> Hours -> Bool #

(<=) :: Hours -> Hours -> Bool #

(>) :: Hours -> Hours -> Bool #

(>=) :: Hours -> Hours -> Bool #

max :: Hours -> Hours -> Hours #

min :: Hours -> Hours -> Hours #

Real Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

toRational :: Hours -> Rational #

Show Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

showsPrec :: Int -> Hours -> ShowS #

show :: Hours -> String #

showList :: [Hours] -> ShowS #

Generic Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Associated Types

type Rep Hours :: Type -> Type #

Methods

from :: Hours -> Rep Hours x #

to :: Rep Hours x -> Hours #

ToJSON Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

FromJSON Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Additive Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

zero :: Hours #

invert :: Hours -> Hours #

plus :: Hours -> Hours -> Hours #

minus :: Hours -> Hours -> Hours #

TimeUnit Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Hours Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Hours = D1 ('MetaData "Hours" "Polysemy.Time.Data.TimeUnit" "polysemy-time-0.2.0.3-inplace" 'True) (C1 ('MetaCons "Hours" 'PrefixI 'True) (S1 ('MetaSel ('Just "unHours") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

newtype Minutes Source #

Minutes.

Constructors

Minutes 

Fields

Instances

Instances details
Enum Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Eq Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

(==) :: Minutes -> Minutes -> Bool #

(/=) :: Minutes -> Minutes -> Bool #

Integral Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Num Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Ord Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Real Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Show Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Generic Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Associated Types

type Rep Minutes :: Type -> Type #

Methods

from :: Minutes -> Rep Minutes x #

to :: Rep Minutes x -> Minutes #

ToJSON Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

FromJSON Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Additive Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Minutes Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Minutes = D1 ('MetaData "Minutes" "Polysemy.Time.Data.TimeUnit" "polysemy-time-0.2.0.3-inplace" 'True) (C1 ('MetaCons "Minutes" 'PrefixI 'True) (S1 ('MetaSel ('Just "unMinutes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

newtype Seconds Source #

Seconds.

Constructors

Seconds 

Fields

Instances

Instances details
Enum Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Eq Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Methods

(==) :: Seconds -> Seconds -> Bool #

(/=) :: Seconds -> Seconds -> Bool #

Integral Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Num Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Ord Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Real Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Show Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Generic Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Associated Types

type Rep Seconds :: Type -> Type #

Methods

from :: Seconds -> Rep Seconds x #

to :: Rep Seconds x -> Seconds #

ToJSON Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

FromJSON Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Additive Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Seconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep Seconds = D1 ('MetaData "Seconds" "Polysemy.Time.Data.TimeUnit" "polysemy-time-0.2.0.3-inplace" 'True) (C1 ('MetaCons "Seconds" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSeconds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

newtype MilliSeconds Source #

Milliseconds.

Constructors

MilliSeconds 

Instances

Instances details
Enum MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Eq MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Fractional MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Integral MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Num MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Ord MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Real MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Show MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Generic MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Associated Types

type Rep MilliSeconds :: Type -> Type #

ToJSON MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

FromJSON MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Additive MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep MilliSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep MilliSeconds = D1 ('MetaData "MilliSeconds" "Polysemy.Time.Data.TimeUnit" "polysemy-time-0.2.0.3-inplace" 'True) (C1 ('MetaCons "MilliSeconds" 'PrefixI 'True) (S1 ('MetaSel ('Just "unMilliSeconds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

newtype MicroSeconds Source #

Microseconds.

Constructors

MicroSeconds 

Instances

Instances details
Enum MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Eq MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Fractional MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Integral MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Num MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Ord MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Real MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Show MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Generic MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Associated Types

type Rep MicroSeconds :: Type -> Type #

ToJSON MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

FromJSON MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Additive MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep MicroSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep MicroSeconds = D1 ('MetaData "MicroSeconds" "Polysemy.Time.Data.TimeUnit" "polysemy-time-0.2.0.3-inplace" 'True) (C1 ('MetaCons "MicroSeconds" 'PrefixI 'True) (S1 ('MetaSel ('Just "unMicroSeconds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

newtype NanoSeconds Source #

Nanoseconds. This is the base unit for all conversions.

Constructors

NanoSeconds 

Fields

Instances

Instances details
Enum NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Eq NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Fractional NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Integral NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Num NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Ord NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Real NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Show NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Generic NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Associated Types

type Rep NanoSeconds :: Type -> Type #

ToJSON NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

FromJSON NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Additive NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

TimeUnit NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

Scaling NanoSeconds Int64 Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep NanoSeconds Source # 
Instance details

Defined in Polysemy.Time.Data.TimeUnit

type Rep NanoSeconds = D1 ('MetaData "NanoSeconds" "Polysemy.Time.Data.TimeUnit" "polysemy-time-0.2.0.3-inplace" 'True) (C1 ('MetaCons "NanoSeconds" 'PrefixI 'True) (S1 ('MetaSel ('Just "unNanoSeconds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

convert :: TimeUnit a => TimeUnit b => a -> b Source #

Convert between different time spans.

>>> convert (picosecondsToDiffTime 50000000) :: MicroSeconds
MicroSeconds {unMicroSeconds = 50}
>>> convert (MilliSeconds 5) :: MicroSeconds
MicroSeconds 5000

type AddTimeUnit t u1 u2 = (TimeUnit u1, TimeUnit u2, Torsor t u2) Source #

Convenience alias for addTimeUnit.

addTimeUnit :: forall t u1 u2. AddTimeUnit t u1 u2 => u1 -> t -> t Source #

Add a time unit to an instant.

secondsFrac :: TimeUnit u => u -> Double Source #

Convert a unit into a number of seconds, keeping the subsecond part as fractional digits.