Relaxin the PVP with regards to adding instances

Ross Paterson ross at soi.city.ac.uk
Thu Sep 6 09:34:20 CEST 2012


On Thu, Sep 06, 2012 at 06:01:44AM +0100, Michael Sloan wrote:
> Thing is, that if this is the design goal of the PVP, then _any_
> addition to the exports of a module should necessitate a major version
> bump, because of the potential for clashing unqualified, non-explicit
> imports.

You can make you code proof against additional exports by using explicit
imports, which is why they only need a minor version bump.  But there's
no way to control the import of instances.  The typical issue is that you
add a type or class, and your users want an instance you didn't provide,
so they define one, which will be broken when you add the instance in the
next version.  You may blame the users for defining the orphan instance,
but they had little choice.

The principle should be:
- code that built against a particular version of a package will also
  build against any release with the same major version.
- code using explicit imports that built against a particular version of a
  package will also build against any release with the same minor version.



More information about the Libraries mailing list