Commit Graph

11 Commits

Author SHA1 Message Date
Fintan Halpenny 8404b5925d
radicle: force new or initial construction of LWWReg
Using LWWReg::from will always set the clock value to the default,
which can end up being used wrong.

Instead, introduce a constructor method `initial` to indicate that it
should be used on initial construction, while `new` should be used for
newer values of the register.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-31 15:49:55 +02:00
Alexis Sellier f9c81ab382
Replace `quickcheck` with `qcheck`
The latter is a fork of the former, which adds const generics
and a bunch of other quality of life improvements that aren't
in the original crate due to it being unmaintained.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-04 20:40:54 +01:00
Alexis Sellier ff79347eb0
crdt: Implement `LWWMap` in terms of `GMap`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-02 14:21:50 +01:00
Alexis Sellier 2230c8ddc4
crdt: Relax bounds and take references
The getter-style functions don't need owned keys.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-01 12:05:44 +01:00
Alexis Sellier 41309538fb
crdt: Small improvements and function additions
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-01 12:05:44 +01:00
Alexis Sellier 36ccab2d7a
crdt: Make some improvements to the types
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier cc33d04a7b
crdt: Require `LWWReg` value to be `Semilattice`
* Also derive instances of `Semilattice` for built-in types.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier 0448441418
Use `merge` as the `Semilattice` join method
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-26 17:13:22 +01:00
Alexis Sellier 0482757ce9
Implement `LWWReg` in terms of `Max`
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-23 19:52:20 +01:00
Alexis Sellier b11826b113
Add `LWWMap` and implement `LWWSet` with it
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-23 19:52:20 +01:00
Alexis Sellier 35f061746c
Add `radicle-crdt` crate
Explorations with CRDTs.
2022-11-23 19:52:18 +01:00