First commit for Haskell rewrite