mergeful-0.3.0.0
Safe HaskellNone
LanguageHaskell2010

Data.Mergeful.Timed

Description

Dealing with server times.

If you are importing this module, you are probably doing something wrong.

Synopsis

Documentation

newtype ServerTime Source #

A "time", as "measured" by the server.

This is closer to a version number than an actual timestamp, but that distinction should not matter for your usage of this library.

In any case, a client should not be changing this value.

We use a Word64 instead of a natural. This will go wrong after 2^64 versions, but since that will not happen in practice, we will not worry about it. You would have to sync millions of modifications every second until long after the sun consumes the earth for this to be a problem.

Constructors

ServerTime 

Fields

Instances

Instances details
Eq ServerTime Source # 
Instance details

Defined in Data.Mergeful.Timed

Ord ServerTime Source # 
Instance details

Defined in Data.Mergeful.Timed

Show ServerTime Source # 
Instance details

Defined in Data.Mergeful.Timed

Generic ServerTime Source # 
Instance details

Defined in Data.Mergeful.Timed

Associated Types

type Rep ServerTime :: Type -> Type #

ToJSON ServerTime Source # 
Instance details

Defined in Data.Mergeful.Timed

FromJSON ServerTime Source # 
Instance details

Defined in Data.Mergeful.Timed

HasCodec ServerTime Source # 
Instance details

Defined in Data.Mergeful.Timed

NFData ServerTime Source # 
Instance details

Defined in Data.Mergeful.Timed

Methods

rnf :: ServerTime -> () #

Validity ServerTime Source # 
Instance details

Defined in Data.Mergeful.Timed

type Rep ServerTime Source # 
Instance details

Defined in Data.Mergeful.Timed

type Rep ServerTime = D1 ('MetaData "ServerTime" "Data.Mergeful.Timed" "mergeful-0.3.0.0-IufP8wiUmUb8vtwEhWnzS0" 'True) (C1 ('MetaCons "ServerTime" 'PrefixI 'True) (S1 ('MetaSel ('Just "unServerTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

initialServerTime :: ServerTime Source #

A server time to start with.

incrementServerTime :: ServerTime -> ServerTime Source #

Increment a server time.

data Timed a Source #

A value along with a server time.

Constructors

Timed 

Fields

Instances

Instances details
Eq a => Eq (Timed a) Source # 
Instance details

Defined in Data.Mergeful.Timed

Methods

(==) :: Timed a -> Timed a -> Bool #

(/=) :: Timed a -> Timed a -> Bool #

Show a => Show (Timed a) Source # 
Instance details

Defined in Data.Mergeful.Timed

Methods

showsPrec :: Int -> Timed a -> ShowS #

show :: Timed a -> String #

showList :: [Timed a] -> ShowS #

Generic (Timed a) Source # 
Instance details

Defined in Data.Mergeful.Timed

Associated Types

type Rep (Timed a) :: Type -> Type #

Methods

from :: Timed a -> Rep (Timed a) x #

to :: Rep (Timed a) x -> Timed a #

HasCodec a => ToJSON (Timed a) Source # 
Instance details

Defined in Data.Mergeful.Timed

HasCodec a => FromJSON (Timed a) Source # 
Instance details

Defined in Data.Mergeful.Timed

HasCodec a => HasCodec (Timed a) Source # 
Instance details

Defined in Data.Mergeful.Timed

NFData a => NFData (Timed a) Source # 
Instance details

Defined in Data.Mergeful.Timed

Methods

rnf :: Timed a -> () #

Validity a => Validity (Timed a) Source # 
Instance details

Defined in Data.Mergeful.Timed

Methods

validate :: Timed a -> Validation #

type Rep (Timed a) Source # 
Instance details

Defined in Data.Mergeful.Timed

type Rep (Timed a) = D1 ('MetaData "Timed" "Data.Mergeful.Timed" "mergeful-0.3.0.0-IufP8wiUmUb8vtwEhWnzS0" 'False) (C1 ('MetaCons "Timed" 'PrefixI 'True) (S1 ('MetaSel ('Just "timedValue") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "timedTime") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ServerTime)))