[Haskell-cafe] .cabal: API-compatible library versions
imantc at gmail.com
Tue Jan 26 13:46:48 UTC 2016
Stack may already do something like this, I don't know. Anyway, here is an idea.
Currently .cabal lists version or version range.
What if package info included lists of API-compatible versions of this package?
Let's say one library requires v10 of packageA. Another library
requires v15 of the same packageA. This is a hypothetical scenario :-P
However v10, v15 are API-compatible as far as package maintainer
knows. Package info specifies v10 and v15 as API-compatible too.
What if it were possible to issue:
cabal install packageA
.. and then if v10, v15 are compatible, v15 is returned without warnings.
If v10 and v15 are not compatible, cabal would warn.
Basically instead of library clients needing to test multiple library
versions or requiring 1 exact version, deps could be specified as 1
version (with which development took place) and cabal (with hints from
package maintainers) would figure this out.
It might even be possible to fine-tune it to check modules & symbols
actually used by library consumer app.
More information about the Haskell-Cafe