lspitzner / brittany

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

Support formatting GADTs #298

Closed lspitzner closed 3 years ago

lspitzner commented 4 years ago

This is one more part of #47. Also, unfortunately currently GADT formatting is slightly broken, even though brittany forwards GADT layouting to ghc-exactprint:

data Foo x where
  A :: Int -> Foo Int
  B :: Bool -> Foo Bool
-- is roundtripped to
data Foo x where
  A ::Int -> Foo Int
  B ::Bool -> Foo Bool

Which I guess is another context-sensitive bug in ghc-exactprint. Might depend on the ghc version used. Easiest fix probably is to

tfausak commented 3 years ago

I'm closing this as a duplicate of #217.