Skip to content

Commit

Permalink
derive replicated list lattice
Browse files Browse the repository at this point in the history
  • Loading branch information
rmgk committed Dec 4, 2023
1 parent 7d483eb commit e8de5f6
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@ object ReplicatedList {

def empty[E]: ReplicatedList[E] = ReplicatedList(Epoche.empty, DotFun.empty)

given lattice[E]: Lattice[ReplicatedList[E]] =
new Lattice[ReplicatedList[E]] {
override def merge(left: ReplicatedList[E], right: ReplicatedList[E]): ReplicatedList[E] =
ReplicatedList(left.order merge right.order, left.meta merge right.meta)

override def decompose(a: ReplicatedList[E]): Iterable[ReplicatedList[E]] =
Iterable(a)

}
given lattice[E]: Lattice[ReplicatedList[E]] = Lattice.derived
given hasDots[E]: HasDots[ReplicatedList[E]] with {
extension (dotted: ReplicatedList[E])
def dots: Dots = dotted.meta.dots
Expand Down

0 comments on commit e8de5f6

Please sign in to comment.