Add Haskell implementation