Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Synopsis
- data TimedOut = TimedOut
- data TimeoutUnit
- = NanoSecond
- | MicroSecond
- | MilliSecond
- | Second
- | Minute
- | Hour
- | Day
- | Week
- aTimeoutUnit :: Proxy TimeoutUnit
- timeoutUnitNanos :: TimeoutUnit -> Word64
- newtype Timeout = Timeout Word64
- aTimeout :: Proxy Timeout
- (#) :: Word64 -> TimeoutUnit -> Timeout
- (#>) :: Timeout -> TimeoutUnit -> Word64
- (#<) :: Timeout -> TimeoutUnit -> Word64
- instantly :: Timeout
Documentation
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.
Instances
Exception TimedOut Source # | |
Defined in Data.Timeout toException :: TimedOut -> SomeException # fromException :: SomeException -> Maybe TimedOut # displayException :: TimedOut -> String # | |
Show TimedOut Source # | |
Eq TimedOut Source # | |
data TimeoutUnit Source #
Timeout unit.
Instances
aTimeoutUnit :: Proxy TimeoutUnit Source #
TimeoutUnit
proxy value.
timeoutUnitNanos :: TimeoutUnit -> Word64 Source #
Amount of nanoseconds in a timeout unit.
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:
NanoSecond
- nsMicroSecond
- usMilliSecond
- msSecond
- sMinute
- mHour
- hDay
- dWeek
- w
The Textual
instance accepts this syntax and allows decimal
fractions to be used as amounts:
fmap
toString
(fromStringAs
aTimeout
"1m1.5s0.2us") =Just
"1m1s500ms200ns"
Instances
Bounded Timeout Source # | |
Enum Timeout Source # | |
Ix Timeout Source # | |
Defined in Data.Timeout | |
Num Timeout Source # | |
Read Timeout Source # | |
Integral Timeout Source # | |
Defined in Data.Timeout | |
Real Timeout Source # | |
Defined in Data.Timeout toRational :: Timeout -> Rational # | |
Show Timeout Source # | |
Printable Timeout Source # | |
Textual Timeout Source # | |
Defined in Data.Timeout | |
Eq Timeout Source # | |
Ord Timeout Source # | |