[Haskell-cafe] How to determine correct dependency versions for a library?

Clark Gaebel cgaebel at uwaterloo.ca
Fri Nov 9 18:30:09 CET 2012


Just like if your C application depends on either SQLite 2 or SQLite 3,
you're going to need to test it with both before a release.

Hoping that your library works against a previous major revision is just
asking for trouble!

I usually just take the easy way out and switch to ==0.7.


On Fri, Nov 9, 2012 at 11:31 AM, Janek S. <fremenzone at poczta.onet.pl> wrote:

> Thanks Clark! You're method seems good at first but I think I see a
> problem. So let's say you
> started with aeson 0.6. As new versions of aeson are released you
> introduce version ranges, but
> do you really have a method to determine that your package does indeed
> work with earlier
> versions? If you're upgrading aeson and don't have the older versions
> anymore you can only hope
> that the code changes you introduce don't break the dependency on earlier
> versions. Unless I am
> missing something?
>
> Janek
>
> Dnia piątek, 9 listopada 2012, Clark Gaebel napisał:
> > What I usually do is start out with dependencies listed like:
> >
> > aeson ==0.6.*
> >
> > and then, as your dependencies evolve, you either bump the version
> number:
> >
> > aeson ==0.7.*
> >
> > or, if you're willing to support multiple version, switch to a range:
> >
> > aeson >=0.6 && <= 0.7
> >
> > If someone uses a previous version of a library, and wants your library
> to
> > support it too (and, preferably, it works out of the box), they'll send a
> > pull request.
> >
> > That's what works for me. Maybe you could use it as a starting point to
> > find what works for you!
> >
> >   - Clark
> >
> > On Fri, Nov 9, 2012 at 11:15 AM, Janek S. <fremenzone at poczta.onet.pl>
> wrote:
> > > Recently I started developing a Haskell library and I have a question
> > > about package dependencies.
> > > Right now when I need my project to depend on some other package I only
> > > specify the package name
> > > in cabal file and don't bother with providing the package version. This
> > > works because I am the
> > > only user of my library but I am aware that if the library were to be
> > > released on Hackage I would
> > > have to supply version numbers in the dependencies. The question is how
> > > to determine proper
> > > version numbers?
> > >
> > > I can be conservative and assume that version of libraries in my system
> > > are the minimum required
> > > ones. This is of course not a good solution, because my library might
> > > work with earlier versions
> > > but I don't know a way to check that. What is the best way to
> determine a
> > > minimal version of a
> > > package required by my library?
> > >
> > > I also don't see any sane way of determining maximum allowed versions
> for
> > > the dependencies, but
> > > looking at other packages I see that this is mostly ignored and package
> > > maintainers only supply
> > > lower versions. Is this correct approach?
> > >
> > > Janek
> > >
> > > _______________________________________________
> > > Haskell-Cafe mailing list
> > > Haskell-Cafe at haskell.org
> > > http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121109/66005873/attachment.htm>


More information about the Haskell-Cafe mailing list