Hermes implemenation in Haskell