Closed sellout closed 3 years ago
Describe the bug If MonadComprensions is used, modules that use list comprehensions now error, where Ormolu previously formatted them successfully.
MonadComprensions
To Reproduce Add {-# language MonadComprehensions #-} to a module containing list comprehensions that Ormolu normally passes.
{-# language MonadComprehensions #-}
Expected behavior I think that MonadComprehensions doesn't change the syntax provided by list comprehensions at all, it only weakens the type constraint internally, so code should format identically regardless of that extension. So I think the fix is to replace https://github.com/tweag/ormolu/blob/64735598c78ce9e3ab45c100ee03f4a81599da1c/src/Ormolu/Printer/Meat/Declaration/Value.hs#L705 with
MonadComprehensions
MonadComp -> compBody
Environment
Would you like to open a PR and make this work?
Describe the bug If
MonadComprensions
is used, modules that use list comprehensions now error, where Ormolu previously formatted them successfully.To Reproduce Add
{-# language MonadComprehensions #-}
to a module containing list comprehensions that Ormolu normally passes.Expected behavior I think that
MonadComprehensions
doesn't change the syntax provided by list comprehensions at all, it only weakens the type constraint internally, so code should format identically regardless of that extension. So I think the fix is to replace https://github.com/tweag/ormolu/blob/64735598c78ce9e3ab45c100ee03f4a81599da1c/src/Ormolu/Printer/Meat/Declaration/Value.hs#L705 withEnvironment