One of aeson-2.2
's breaking changes was moving the Data.Aeson.Parser
module out into a new attoparsec-aeson
package. I have some code that uses this module, and I’m not sure how best to continue supporting versions <2.2 and start supporting versions >=2.2.
attoparsec-aeson
depends on aeson
>=2.2.0.0, so I can’t add a new dependency on attoparsec-aeson
and then import the module with a package-qualified import from attoparsec-aeson
instead of aeson
.
It would seem I’d need some conditional in the cabal file that only adds attoparsec-aeson
as a dep if aeson
is >=2.2. Reading this section in the cabal manual (in particular the backtracking search bit) suggests that a configuration flag might work, though that feels like it’d be a somewhat indirect/ad-hoc approach.
Is a configuration flag the standard way of handling this or is there a better way?