lspitzner / brittany

haskell source code formatter
GNU Affero General Public License v3.0
691 stars 72 forks source link

GADT forall does not round-trip on ghc-8.6 #242

Open lspitzner opened 5 years ago

lspitzner commented 5 years ago
data StupidExistential a where
  StupidExistential :: forall a . StupidExistential a

turns into

data StupidExistential a where
  StupidExistential :: a StupidExistential a

(and interestingly into this in the next step, although that really does not matter:)

data StupidExistential a where
  StupidExistential ::a StupidExistential a

This is a bug in ghc-exactprint, confirmed on ghc-exactprint-5.8 and ghc-exactprint-0.6, confirmed on ghc-8.6.5. Does not occur on earlier ghc versions.

Will open an issue on ghc-exactprint. See https://github.com/alanz/ghc-exactprint/issues/79.

Might want a work-around in the meantime.

tfausak commented 5 years ago

The space thing was reported earlier in #217.

lspitzner commented 5 years ago

(This is a bit worse though, because removing forall can break the code.)