definitive-reactive-1.0: A simple Reactive library.

Safe HaskellNone




Unambiguous times

data Time t Source

A type wrappers for timestamps that can be compared unambiguously


Unit Time 
Bounded (Time t) 
Ord t => Eq (Time t) 
Ord t => Ord (Time t) 
(Eq t, Show t) => Show (Time t) 
Ord t => Semigroup (Time t)

The Time semigroup where ta + tb == max ta tb

Ord t => Monoid (Time t)

The Time monoid where zero == minBound

Ord t => Semiring (Time t)

The Time ring where (*) == min and one == maxBound

Ord t => Ring (Time t) 
Ord t => Orderable (Time t) 

timeVal :: Time t -> TimeVal tSource

A Time's pure value. Reduction to normal form may block.

Time utilities

timeIO :: IO a -> IO (Time Seconds)Source

Constructs a Time representing the time by which the argument terminates.

Warning: This function executes its argument, ignoring its value. Thus, it would be wise to use it on idempotent blocking actions, such as readMVar.

timeOrigin :: ([birthTime :: Seconds] => IO a) -> IO aSource

Conversion functions