tweag / ormolu

A formatter for Haskell source code
https://ormolu-live.tweag.io
Other
954 stars 83 forks source link

Format existential data types better #1077

Closed brandonchinn178 closed 8 months ago

brandonchinn178 commented 10 months ago

I think this should be the correct formatting:

data IndexWithInfo schema =
  forall x.
  IndexWithInfo
    { checkedIndex :: Index schema x
    , checkedIndexName :: U.Variable
    , checkedIndexType :: Type x
    }

Currently, Ormolu reformats this to

data IndexWithInfo schema = forall x.
  IndexWithInfo
  { checkedIndex :: Index schema x
  , checkedIndexName :: U.Variable
  , checkedIndexType :: Type x
  }
amesgen commented 10 months ago

Yeah, I think we could respect few more linebreaks here, also see #947.