In the dependencies section of a cabal file:
Build-Depends: base >= 3 && < 5, transformers >= 0.2.0
Should I be doing something like
Build-Depends: base >= 3 && < 5, transformers >= 0.2.0 && < 0.3.0
(putting upper limits on versions of packages I depend on)
or not?
I'll use a real example: my "List" package on Hackage (List monad transformer and class)
lift
and liftIO
with ListT
because it's only an instance of these classes of transformers-0.2.xI guess that applications should always put upper limits so that they never break, so this question is only about libraries:
Shall I use the upper version limit on dependencies or not?
There is an explicit policy recommending upper bounds - see in particular section 3 ("Dependencies in Cabal"). The other answers give some further justification for this policy.
In short - the upper limit should be in form of < A.(B+1)
where A and B are the first elements of the current version (A.B.C...
). This is because increasing A.B
should mean that the version breaks old APIs.