-showTuple :: TyCon -> [TypeRep] -> ShowS
-showTuple (TyCon _ str) args = showChar '(' . go str args
- where
- go [] [a] = showsPrec 10 a . showChar ')'
- go _ [] = showChar ')' -- a failure condition, really.
- go (',':xs) (a:as) = showsPrec 10 a . showChar ',' . go xs as
- go _ _ = showChar ')'
+showTuple :: [TypeRep] -> ShowS
+showTuple args = showChar '('
+ . (foldr (.) id $ intersperse (showChar ',')
+ $ map (showsPrec 10) args)
+ . showChar ')'