[Haskell-cafe] Are conditional changes in library interfaces problematic?
adam at bergmark.nl
Fri Feb 6 12:36:49 UTC 2015
transformers 0.4 deprecated ErrorT in favor of ExceptT. I've noticed that
several packages use CPP to conditionally add ExceptT instances, like this:
instance C m => C (ExceptT e m) where
The problem I've found with this is that I will get a different interface
depending on which transformers version is picked.
There is a transformers-compat library that provides ExceptT when using
older versions of transformers, when combining these I end up with a
compilation failure since the ExceptT instances are no longer included due
The alternatives I see are:
1. Use transformers-compat (and as of today mtl-compat)
2. Drop support of older versions of dependencies
3. Advise against compat packages
The first alternative seems preferable from a user's standpoint. For
transformers and mtl I argue it's the most pragmatic option. I think the
compat packages are a good thing, especially for core packages, since they
let us maintain backwards compatibility.
Do you agree with this line of thought? I started working on pull requests
to "fix" this but I'd appreciate feedback on the issue first.
Along these lines, does conditionally altering the interface of a package
like this violate the PVP?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe