haskell / stylish-haskell

Haskell code prettifier
Other
988 stars 151 forks source link

`stylish-haskell-0.14.3.0` build fails on Hackage #441

Closed billksun closed 1 year ago

billksun commented 1 year ago

See https://hackage.haskell.org/package/stylish-haskell-0.14.3.0/reports/.

I also get the same error when using haskell.nix with HLS on GHC 9.2.5.

amesgen commented 1 year ago

As ghc-lib-parser-ex flipped the default of ghc-lib to True (see https://github.com/shayne-fletcher/ghc-lib-parser-ex/pull/123 and https://github.com/ndmitchell/hlint/issues/1376), stylish-haskell will fail to compile (without manually-specified flags) on the GHC AST version that is currently in use (i.e. 0.14.4.0 fails to compile on exactly GHC 9.4).

One can work around this by manually setting the ghc-lib flag of stylish-haskell to True (or alternatively, to False for ghc-lib-parser-ex), but this is not immediately obvious for a user. So there is a tradeoff between

Tools like hlint took the route of enabling ghc-lib by default; so I created #445 to do the same here.