typed-duration-0.1.1.0: Thread delay and timeout functions with typed arguments

Safe HaskellNone
LanguageHaskell2010

Data.Duration

Contents

Description

Definition of Duration and various other types, constructors and functions for building Durations.

Synopsis

Duration type

data DurationUnit Source #

Duration units to be used with #. See constructor docs for max duration values for each unit.

Constructors

Microsecond

Max bound: 9223372036854775807

Millisecond

Max bound: 9223372036854775

Second

Max bound: 9223372036854

Minute

Max bound: 153722867280

Hour

Max bound: 2562047788

Day

Max bound: 106751991

Week

Max bound: 15250284

(#) :: Int -> DurationUnit -> Duration Source #

Make a duration from a value + unit. Note that this function does not check overflows. See DurationUnit for max bounds for units.

Non-operators for building durations

Num types for building durations from integer literals

newtype Hours Source #

Constructors

Hours_ 

Fields

newtype Days Source #

Constructors

Days_ 

Fields

Instances

Eq Days Source # 

Methods

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

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

Num Days Source # 

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 # 

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 #

Show Days Source # 

Methods

showsPrec :: Int -> Days -> ShowS #

show :: Days -> String #

showList :: [Days] -> ShowS #

ToDuration Days Source # 

type Day = Days Source #

newtype Weeks Source #

Constructors

Weeks_ 

Fields