def GCounter.add

bend-kit-crdt@0.2.0.0 · crdt.bend:78

import bend-kit-crdt@0.2.0.0/crdt.bend as Crdt
import Base

78def GCounter.add(m: Maybe<&2, U32>, +c: U32) -> Maybe<&2, U32>:
79  match m:
80    case None{}:
81      None{}
82    case Some{+a}:
83      Bool.pick(Maybe<&2, U32>, U32.is_le(a, (a + c : U32)), Some{(a + c : U32)}, None{})

Uses (5)

Used by (2)