A practical guide to using automatic flags in Cabal package definitions to handle base library version compatibility in Haskell. Instead of using semantically incorrect `impl(ghc >= x.y)` conditionals, the author advocates for deterministic automatic flags tied to base library versions (e.g., `base-ge-4-17`). This approach correctly expresses compatibility in terms of library versions rather than compiler versions, and incidentally improves compatibility with alternative Haskell compilers like MicroHs. The post also notes that while library-level compatibility is manageable, language extension compatibility in .cabal files remains an unsolved problem.

4m read timeFrom oleg.fi
Post cover image
Table of contents
# An example# Low-level tools for high level concept# Conclusion

Sort: