Implementation of distributed consensus algorithms in Haskell