B]:      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o pqrstuvwxyz{|}~SafeA semilattice.EIt may be a join-semilattice, or meet-semilattice, it doesn't matter.#If it matters for you, use package lattices.In addition to  , Semilattice defines this laws:  commutativity x  y == y  x idempotency x  x == xJust (), specialized to .6NoneI Key is  '. Non-present value is equivalent to 0. Unique process identifier         Safe'XXX Internal TODO remove !"#$%&'() !"#$%&' !"#$%&' !"#$%&'()None ,-./0123,-./01,-/.01 ,-./0123Safe6Construct new value67676767Safe8 Grow-only set9update:initialization; lookup query89:;89:;89:;89:;Safe<Grow-only counter.>Increment counter? Initial state@Get value from the stateASee CvRDT<=> replica id?@AB<=>?@<=?@><=>?@ABSafe#EnPositive-negative counter. Allows incrementing and decrementing. Nice example of combining of existing CvRDT (<' in this case) to create another CvRDT.IGet value from the stateJDecrement counterKIncrement counterL Initial stateMSee CvRDT EFGHIJ replica idK replica idLMNEFGHIJKLEFGHLIJKEFGHIJKLMN Safe*Q5State-based, or convergent (Cv) replicated data type.!Update is any function modifying state.GQuery function is not needed. State itself is exposed. In other words, query = 7. Some types may offer more convenient query functions.$Actually, a CvRDT is nothing more a .QQQQ None6:DRR:Operation-based, or commutative (Cm) replicated data type.Implementation;In Haskell, a CmRDT implementation consists of 3 types  a payload, an  operation (op ) and an intent. PayloadInternal state of a replica.IntentUser's request to update.Operation (Op)*Operation to be applied to other replicas.For many types  operation and intent may be the same. But for i, for instance, this rule doesn't hold: user can request only value, and type attaches a timestamp to it.)Additional constraint  commutativity law(Concurrent updates are observed equally.  " op1 op2 . Y op1 op2 ==> V op1 . V op2 == V op2 . V op1 !Idempotency doesn't need to hold.U4Generate an update to the local and remote replicas.Returns - if the intended operation is not applicable.VCApply an update to the payload. An invalid update must be ignored.WlPartial order for causal semantics. Values of some type may be ordered and causally-ordered different ways.Xx X y means that x must go before y and y can not go before x.Y*Not comparable, i. e. (a "d b) "' (b "d a). RSTUVWXYRTSVUWXY WXRSTUUVYRSTUUVWXY None 9;<=DR[]*Empty order, allowing arbitrary reorderingZ[\]^Z[\Z[\Z[\]^ NoneDRcdefcdcdcdef NoneDR[ijklmijkijkijklmNone#DRpBLast write wins. Assuming timestamp is unique. This type is both R and CvRDT.Timestamps are assumed unique, totally ordered, and consistent with causal order; i.e., if assignment 1 happened-before assignment 2, the former s timestamp is less than the latter s.tInitialize stateudChange state as CvRDT operation. Current value is ignored, because new timestamp is always greater.v Query statezSee CvRDT{(Merge by choosing more recent timestamp. pqrstuvwxyz{pqsrtuvwpqrstuvw pqrstuvwxyz{None9; ~~~~ !"#$%&'()*+,-./01123456789:;<<3254=>?@3AB234CCD3AEFGHIIJKALD3MNOP Q R S T U V W X Y Z [ \ ] ^ _ ` a b B c d e f g 1 c h i j : ;kl3mAnopqrstuv3254wxyz{|}~ crdt-3.0-17iRCkNFXpPIxTmOKlLCCy CRDT.Cv.MaxData.SemilatticeCRDT.LamportClockCRDT.Cv.TwoPSet CRDT.Cv.ORSet CRDT.Cv.GSetCRDT.Cv.GCounterCRDT.Cv.PNCounterCRDT.CvCRDT.CmCRDT.Cm.Counter CRDT.Cm.GSetCRDT.Cm.TwoPSetCRDT.LWWCRDT.Cv.LwwElementSet Semigroup<> CRDT.Cm.LWWLWWbaseData.SemigroupgetMaxMax Semilatticemerge$fSemilatticeSet$fSemilatticeMaxProcess LamportClockPid LamportTimegetPidgetTimerunLamportClock runProcessadvance$fEqPid$fOrdPid $fShowPid$fEqLamportTime$fOrdLamportTime$fShowLamportTime$fApplicativeLamportClock$fFunctorLamportClock$fMonadLamportClock$fApplicativeProcess$fFunctorProcess$fMonadProcessTwoPSetaddinitiallookupremove singletonisKnown$fSemilatticeTwoPSet$fSemigroupTwoPSet $fEqTwoPSet $fShowTwoPSetORSet$fSemilatticeORSet$fSemigroupORSet $fEqORSet $fShowORSetqueryGSetGCounter increment$fSemilatticeGCounter$fSemigroupGCounter $fEqGCounter$fShowGCounter PNCounterpositivenegative decrement$fSemilatticePNCounter$fSemigroupPNCounter $fEqPNCounter$fShowPNCounterCvRDTCmRDTIntentPayloadmakeOpapply CausalOrdaffects concurrentCounter Increment Decrement$fCausalOrdCounter$fCmRDTCounter$fBoundedCounter $fEnumCounter $fEqCounter $fShowCounterAdd$fCausalOrdGSet $fCmRDTGSet$fEqGSet $fShowGSetRemove$fCausalOrdTwoPSet$fCmRDTTwoPSetvaluetimeassignadvanceFromLWW $fCmRDTLWW$fCausalOrdLWW$fSemilatticeLWW$fSemigroupLWW$fEqLWW $fShowLWW LwwElementSetLES$fSemilatticeLwwElementSet$fSemigroupLwwElementSet$fEqLwwElementSet$fShowLwwElementSet LocalTimepreIncrementAtTagunpackGHC.BaseidNothing comparableadvanceFromLES