Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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

[2:] http://noelwelsh.com/programming/2013/12/20/crdts-for-fun-an...

[3:] https://github.com/noelwelsh/crdt



Thanks Noel, I had seen algebird before - it looks great!


It's only a monoid if there's an identity.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: