Generate Haskell code from a type