Closed srid closed 4 years ago
-- |
string denotes a Haddock comment, but used in a wrong place in this case.
Quoting @mrkkrp from another issue:
It should be obivous that Ormolu has to work with Haddocks. Both Ormolu and the Haddock executable use GHC parser with a special setting to extract Haddocks. The thing is, though, that once this setting is activated, the input must form a finished Haskell module with correct Haddocks, otherwise it is a parse error.
It's a bit unfortunate that Ormolu fails in a correct Haskell program, but there is nothing much it can do since it is also responsible for reformatting Haddock comments too. A temporary solution in this case would be putting one more space before |
so that it is not recognized as a Haddock comment.
Yeah, as @utdemir point out, this is just not a valid input for GHC in Haddock mode and there is little we can do.
For this code:
Ormolu will fail: