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

Clark Gaebel cgaebel at uwaterloo.ca
Fri Nov 9 18:48:24 CET 2012


It's not restrictive. Anything that I put on Hackage is open source. If
someone finds that it works fine on a previous (or later) version, I accept
their patch with a constraint change, and re-release immediately. I just
don't like to claim that my package works with major versions of packages
that I haven't tested.


On Fri, Nov 9, 2012 at 12:36 PM, Janek S. <fremenzone at poczta.onet.pl> wrote:

> > I usually just take the easy way out and switch to ==0.7.
> I see. I guess I don't yet have enough experience in Haskell to anticipate
> how restrictive is such
> a choice.
>
> Janek
>
> >
> > 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/9dda1cc4/attachment.htm>


More information about the Haskell-Cafe mailing list