qualified imports, PVP and so on

Michael Snoyman michael at snoyman.com
Wed Feb 26 09:37:43 UTC 2014

On Wed, Feb 26, 2014 at 11:17 AM, Johan Tibell <johan.tibell at gmail.com>wrote:

> Hi Michael,
> On Wed, Feb 26, 2014 at 6:45 AM, Michael Snoyman <michael at snoyman.com>wrote:
>> That's essentially it. I'll give one of the examples I ran into. (Names
>> omitted on purpose, if the involved party wants to identify himself, please
>> do so, I just didn't feel comfortable doing so without your permission.)
>> Version 0.2 of monad-logger included MonadLogger instances for IO and other
>> base monads. For various reasons, these were removed, and the version
>> bumped to 0.3. This is in full compliance with the PVP.
>> persistent depends on monad-logger. It can work with either version 0.2
>> or 0.3 of monad-logger, and the cabal file allows this via `monad-logger >=
>> 0.2 && < 0.4` (or something like that). Again, full PVP compliance.
>> A user wrote code against persistent when monad-logger version 0.2 was
>> available. He used a function that looked like:
>> runDatabase :: MonadLogger m => Persistent a -> m a
>> (highly simplified). In his application, he used this in the IO monad. He
>> depended on persistent with proper lower and upper bounds. Once again, full
>> PVP compliance.
>> Once I released version 0.3 of monad-logger, his next build automatically
>> upgraded him to monad-logger 0.3, and suddenly his code broke, because
>> there's no MonadLogger instance for IO.
>> Now *if* the program had been using a system like "cabal freeze" or the
>> like, this could have never happened: cabal wouldn't be trying to
>> automatically upgrade to monad-logger 0.3.
> I'm trying to wrap my head around this.
>  * Is runDatabase above a function in persistent or related packages or a
> function that the user wrote?

It was in persistent. The actual function name is different, but the
concept is the same.

>   * What was the user's dependency range for monad-logger? If he is using
> the IO instance of MonadLogger from monad-logger, he ought to have a
> monad-logger == 2.0.* dependency (since removing instances require a major
> version bump.)

The user didn't directly depend on monad-logger at all, as there was no
need with version 0.2 of monad-logger.

>   * Does any involved package use orphan instances?
Nope, no orphans at all.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140226/9abce82b/attachment.html>

More information about the Libraries mailing list