butler-0.0.1.0: At your service.
Safe HaskellSafe-Inferred
LanguageGHC2021

Butler.Core.Clock

Description

Clock provides timing facility

Synopsis

Documentation

data Clock #

Read time

data Time #

The number of milli secondes since the clock started.

Instances

Instances details
ToJSON Time # 
Instance details

Defined in Butler.Core.Clock

Enum Time # 
Instance details

Defined in Butler.Core.Clock

Methods

succ :: Time -> Time #

pred :: Time -> Time #

toEnum :: Int -> Time #

fromEnum :: Time -> Int #

enumFrom :: Time -> [Time] #

enumFromThen :: Time -> Time -> [Time] #

enumFromTo :: Time -> Time -> [Time] #

enumFromThenTo :: Time -> Time -> Time -> [Time] #

Num Time # 
Instance details

Defined in Butler.Core.Clock

Methods

(+) :: Time -> Time -> Time #

(-) :: Time -> Time -> Time #

(*) :: Time -> Time -> Time #

negate :: Time -> Time #

abs :: Time -> Time #

signum :: Time -> Time #

fromInteger :: Integer -> Time #

Integral Time # 
Instance details

Defined in Butler.Core.Clock

Methods

quot :: Time -> Time -> Time #

rem :: Time -> Time -> Time #

div :: Time -> Time -> Time #

mod :: Time -> Time -> Time #

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

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

toInteger :: Time -> Integer #

Real Time # 
Instance details

Defined in Butler.Core.Clock

Methods

toRational :: Time -> Rational #

Show Time # 
Instance details

Defined in Butler.Core.Clock

Methods

showsPrec :: Int -> Time -> ShowS #

show :: Time -> String #

showList :: [Time] -> ShowS #

Eq Time # 
Instance details

Defined in Butler.Core.Clock

Methods

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

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

Ord Time # 
Instance details

Defined in Butler.Core.Clock

Methods

compare :: Time -> Time -> Ordering #

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

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

(>) :: Time -> Time -> Bool #

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

max :: Time -> Time -> Time #

min :: Time -> Time -> Time #

ToHtml Time # 
Instance details

Defined in Butler.Core.Clock

Methods

toHtml :: forall (m :: Type -> Type). Monad m => Time -> HtmlT m () #

toHtmlRaw :: forall (m :: Type -> Type). Monad m => Time -> HtmlT m () #

Serialise Time # 
Instance details

Defined in Butler.Core.Clock

From Time Milli # 
Instance details

Defined in Butler.Core.Clock

Methods

from :: Time -> Milli #

From Time ByteString # 
Instance details

Defined in Butler.Core.Clock

Methods

from :: Time -> ByteString #

From Time Text # 
Instance details

Defined in Butler.Core.Clock

Methods

from :: Time -> Text #

From Time Natural # 
Instance details

Defined in Butler.Core.Clock

Methods

from :: Time -> Natural #

From Natural Time # 
Instance details

Defined in Butler.Core.Clock

Methods

from :: Natural -> Time #

Duration

newtype Milli #

A duration in millisecond

Constructors

Milli Natural 

Instances

Instances details
Enum Milli # 
Instance details

Defined in Butler.Core.Clock

Num Milli # 
Instance details

Defined in Butler.Core.Clock

Show Milli # 
Instance details

Defined in Butler.Core.Clock

Methods

showsPrec :: Int -> Milli -> ShowS #

show :: Milli -> String #

showList :: [Milli] -> ShowS #

Eq Milli # 
Instance details

Defined in Butler.Core.Clock

Methods

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

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

Ord Milli # 
Instance details

Defined in Butler.Core.Clock

Methods

compare :: Milli -> Milli -> Ordering #

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

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

(>) :: Milli -> Milli -> Bool #

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

max :: Milli -> Milli -> Milli #

min :: Milli -> Milli -> Milli #

From Time Milli # 
Instance details

Defined in Butler.Core.Clock

Methods

from :: Time -> Milli #

sleep :: MonadIO m => Milli -> m () #

Pause the execution.

stm helpers

data WaitResult result #

Constructors

WaitCompleted result 
WaitTimeout 

Instances

Instances details
ToJSON result => ToJSON (WaitResult result) # 
Instance details

Defined in Butler.Core.Clock

Methods

toJSON :: WaitResult result -> Value #

toEncoding :: WaitResult result -> Encoding #

toJSONList :: [WaitResult result] -> Value #

toEncodingList :: [WaitResult result] -> Encoding #

Show result => Show (WaitResult result) # 
Instance details

Defined in Butler.Core.Clock

Methods

showsPrec :: Int -> WaitResult result -> ShowS #

show :: WaitResult result -> String #

showList :: [WaitResult result] -> ShowS #

waitTransaction :: MonadIO m => Milli -> STM result -> m (STM (WaitResult result)) #

Wait for a transaction with a timeout.