Refactor the Haskell.Program module