Adds working haskell implementation!