Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Mutable value with associated last write time
Synopsis
- data TimedValue t a = TimedValue t a
Documentation
data TimedValue t a Source #
Value with Eq/Ord instances uniquely based on time field indicating the time the value was last written.
This can be used with IOVar/IOTree which use Eq instances to detect value changes. It can be useful for values that we don't want to structurally compare (because it is too costly or because we can't)
t
should be SystemTime (fast to query monotonic clock)
TimedValue t a |
Instances
Eq t => Eq (TimedValue t a) Source # | |
Defined in Haskus.Utils.TimedValue (==) :: TimedValue t a -> TimedValue t a -> Bool # (/=) :: TimedValue t a -> TimedValue t a -> Bool # | |
Ord t => Ord (TimedValue t a) Source # | |
Defined in Haskus.Utils.TimedValue compare :: TimedValue t a -> TimedValue t a -> Ordering # (<) :: TimedValue t a -> TimedValue t a -> Bool # (<=) :: TimedValue t a -> TimedValue t a -> Bool # (>) :: TimedValue t a -> TimedValue t a -> Bool # (>=) :: TimedValue t a -> TimedValue t a -> Bool # max :: TimedValue t a -> TimedValue t a -> TimedValue t a # min :: TimedValue t a -> TimedValue t a -> TimedValue t a # |