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@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@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe