rewrite haskell stub generator