[Haskell-cafe] Package versioning policy - Harmless type changes?
Felipe Almeida Lessa
felipe.lessa at gmail.com
Thu Sep 22 13:32:09 CEST 2011
On Thu, Sep 22, 2011 at 7:37 AM, Heinrich Apfelmus
<apfelmus at quantentunnel.de> wrote:
> - foo :: Typeable a => AddHandler a -> NetworkDescription (Event a)
> + foo :: AddHandler a -> NetworkDescription (Event a)
> Can removing a type class constraint on a function break dependent code?
> Should I change the B number or just the C in version A.B.C when introducing
> this change?
This change would break only backwards compatibility. For example,
suppose that the version with "Typeable a =>" is 0.1.2 and the version
without is 0.1.3. Suppose that you have already released your version
0.1.3 when I create a package with the value:
bar :: NetworkDescription (Event (Set a))
bar = ... foo ...
Given that you are following the PVP, I would put the following constraint:
Build-depends: foo >= 0.1 && < 0.2
However, if someone with an older version of foo installed on their
system tried to install my package, they would get a type error, since
I haven't put a "Typeable a =>" context on my bar.
So, yes, that change can break some code. Is that change big enough
to be considered harmful? I don't know =), probably not.
More information about the Haskell-Cafe