[Haskell] parsing and printing user defined types