Add fold support for haskell