data-timeout-0.3.1: 64-bit timeouts of nanosecond precision
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Timeout

Synopsis

Documentation

data TimedOut Source #

Exception that is raised when an operation times out. Not used by the package itself, it is here so that users don't need to roll their own exception type every time.

Constructors

TimedOut 

Instances

Instances details
Exception TimedOut Source # 
Instance details

Defined in Data.Timeout

Show TimedOut Source # 
Instance details

Defined in Data.Timeout

Eq TimedOut Source # 
Instance details

Defined in Data.Timeout

data TimeoutUnit Source #

Timeout unit.

Instances

Instances details
Bounded TimeoutUnit Source # 
Instance details

Defined in Data.Timeout

Enum TimeoutUnit Source # 
Instance details

Defined in Data.Timeout

Ix TimeoutUnit Source # 
Instance details

Defined in Data.Timeout

Read TimeoutUnit Source # 
Instance details

Defined in Data.Timeout

Show TimeoutUnit Source # 
Instance details

Defined in Data.Timeout

Printable TimeoutUnit Source # 
Instance details

Defined in Data.Timeout

Methods

print :: Printer p => TimeoutUnit -> p Source #

Textual TimeoutUnit Source # 
Instance details

Defined in Data.Timeout

Methods

textual :: (Monad μ, CharParsing μ) => μ TimeoutUnit Source #

Eq TimeoutUnit Source # 
Instance details

Defined in Data.Timeout

Ord TimeoutUnit Source # 
Instance details

Defined in Data.Timeout

timeoutUnitNanos :: TimeoutUnit -> Word64 Source #

Amount of nanoseconds in a timeout unit.

newtype Timeout Source #

Timeout in nanoseconds. The Printable instance renders timeouts as series of AmountUnit tokens, e.g.

     toString (1 # Day + 1500 # MilliSecond) = "1d1s500ms"
  

The full list of timeout unit abbreviations:

The Textual instance accepts this syntax and allows decimal fractions to be used as amounts:

    fmap toString (fromStringAs aTimeout "1m1.5s0.2us") = Just "1m1s500ms200ns"
  

Constructors

Timeout Word64 

Instances

Instances details
Bounded Timeout Source # 
Instance details

Defined in Data.Timeout

Enum Timeout Source # 
Instance details

Defined in Data.Timeout

Ix Timeout Source # 
Instance details

Defined in Data.Timeout

Num Timeout Source # 
Instance details

Defined in Data.Timeout

Read Timeout Source # 
Instance details

Defined in Data.Timeout

Integral Timeout Source # 
Instance details

Defined in Data.Timeout

Real Timeout Source # 
Instance details

Defined in Data.Timeout

Show Timeout Source # 
Instance details

Defined in Data.Timeout

Printable Timeout Source # 
Instance details

Defined in Data.Timeout

Methods

print :: Printer p => Timeout -> p Source #

Textual Timeout Source # 
Instance details

Defined in Data.Timeout

Methods

textual :: (Monad μ, CharParsing μ) => μ Timeout Source #

Eq Timeout Source # 
Instance details

Defined in Data.Timeout

Methods

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

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

Ord Timeout Source # 
Instance details

Defined in Data.Timeout

(#) :: Word64 -> TimeoutUnit -> Timeout infix 9 Source #

Convert the given number of timeout units to Timeout.

(#>) :: Timeout -> TimeoutUnit -> Word64 infix 8 Source #

Extract number of units (rounding up).

(#<) :: Timeout -> TimeoutUnit -> Word64 infix 8 Source #

Extract number of units (rounding down).

instantly :: Timeout Source #

Zero timeout. The event in question should occur immediately.