Add beginning of haskell implementation