[haskell] use function rather than overriding show