cabal gen-bounds

A useful cabal command that reduces tiresome dependency version hunting on Hackage.

In your project’s Cabal file, write your dependencies without bounds at first, like this:

build-depends:       base >=4.9 && <4.10,
megaparsec,
tagsoup-megaparsec

Then run cabal update & cabal build and see if it compiles.

If it compiles, run

cabal gen-bounds

And you will get nice suggestions like

megaparsec          >= 5.0.1 && < 5.1,
tagsoup-megaparsec >= 0.2.0 && < 0.3,