tfausak / cabal-gild

:crown: Format Haskell package descriptions.
https://hackage.haskell.org/package/cabal-gild
MIT License
49 stars 5 forks source link

Fix rendering of conditionals #83

Closed tfausak closed 5 months ago

tfausak commented 5 months ago

Fixes #72.

tfausak commented 5 months ago

This was more involved than you might think at first. I have been trying to lean on Cabal-syntax as much as possible. However for conditionals I wasn't able to do that. First of all there are no Parsec or Pretty instances for them. But even if there were, the Condition data type doesn't have a constructor for parentheses, so those would be lost. Also the parsers would have to be "permissive", which they might not be. So that's why I made my own Condition and Variable types. Everything else followed from that.