restructuring of the Haskell support code