nomeata / cabal-plan-bounds

Calculate Haskell dependency ranges from multiple build plans
BSD 2-Clause "Simplified" License
33 stars 3 forks source link

Add option to use set notation #18

Open sellout opened 8 months ago

sellout commented 8 months ago

Cabal 3.0 added set notation for version bounds, but cabal-plan-bounds doesn’t yet support it, and so removes it from existing bounds.

-    base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0},
+    base ^>=4.12.0 || ^>=4.13.0 || ^>=4.14.0 || ^>=4.15.0 || ^>=4.16.0 || ^>=4.17.0 || ^>=4.18.0 || ^>=4.19.0

I feel like it’d be ideal to auto-detect whether cabal-version >= 3.0, but an explicit option to use set notation would be fine, too.

It’s just much more readable for many-versioned bounds, IMO.

sellout commented 8 months ago

Ah, I see that this is a consequence of Pretty VersionRange, and that set notation is just syntactic sugar in the parser, not maintained in the AST.

nomeata commented 8 months ago

Thanks for the suggestion. I'd use it if the pretty printer spat it out as such. I don't think it's worth an option, though (cost of documenting, of users having to think about it).