Skip to content

Template Haskell pretty printer arrow always associates right

When I run a Template Haskell-generated tysig declaration through pprint, the associativity for -> comes out incorrectly, e.g.:

sigD (mkName "foo") [t|(Int -> Bool) -> Bool|]

renders as:

foo :: GHC.Base.Int -> GHC.Base.Bool -> GHC.Base.Bool

(note that it's dropping the parens, associating right instead of left)

Edited by Ian Lynagh -
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information