5 ms·
It's an idempotent commutative monoid, so you can encode that quite straightforwardly as a type class. Twitter's Algebird[1] has a wide range of monoid impleme
by noelwelsh 12y ago
It's an idempotent commutative monoid, so you can encode that quite straightforwardly as a type class.
Twitter's Algebird[1] has a wide range of monoid implementations (in Scala). It's a surprisingly useful type class for something so simple.
I have a talk[2] and some code [3] that goes into more detail on CRDTs and the connection to monoids.
[1:] https://github.com/twitter/algebird https://github.com/twitter/algebird
[2:] http://noelwelsh.com/programming/2013/12/20/crdts-for-fun-and-eventual-profit/ http://noelwelsh.com/programming/2013/12/20/crdts-for-fun-an...
[3:] https://github.com/noelwelsh/crdt https://github.com/noelwelsh/crdt