For your particular example, you can use the transformers-compat package. But to answer your general question: for applications, I strongly advocate supporting just a single set of package version combos for dependencies. Stack does do this by default, but cabal freeze files can get you most of the way there too (barring some corner cases with different OSes and OS-specific packages).
I'm sure others will disagree with this recommendation, but I see no reason to absorb a large amount of compatibility work just so that two installations of the same application may end up behaving differently at runtime because of differences in the behavior of a dependency.
_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Hi all,IIUC, people used to spend nontrivial effort making their Haskell tools work across a range of dependencies, and be careful about dropping support for older ones.
Do cabal sandboxes or Stack reduce that need, at least for applications?* Or conversely, how bad is it to restrict support to users having them? I guess I am asking about common policies, but this probably depends on adoption of those tools.
For your particular example, you can use the transformers-compat package.
But to answer your general question: for applications, I strongly advocate supporting just a single set of package version combos for dependencies. Stack does do this by default, but cabal freeze files can get you most of the way there too (barring some corner cases with different OSes and OS-specific packages).
I'm sure others will disagree with this recommendation, but I see no reason to absorb a large amount of compatibility work just so that two installations of the same application may end up behaving differently at runtime because of differences in the behavior of a dependency.
Omari Norman writes:
> Someone installing an application can just use stack and Stackage.
I wonder how many people would be using XMonad, git-annex, etc. if this
view were common place among application developers.
I'm pretty sure that a large part of the user base of these tools has no
clue "stack" exists, even, and the only reason why they can install
these programs is because their distributions package manager allows
then to do so without exposing them to any Haskell-specific build tools.
> But developers of, say, `hlint` have (I guess arguably) another
> target audience — Haskell developers; my question was about this
> audience, and Omari Norman's answer makes sense there.
personally, I never install anything with stack or cabal-install,
regardless of whether it's a tool intended for Haskell developers or
not. Stack and cabal-install are great tools to use during code
development, but neither of them has the capabilities I want from a
package manager.
Just my 2 cents,
Omari Norman writes:
> Someone installing an application can just use stack and Stackage.
I wonder how many people would be using XMonad, git-annex, etc. if this
view were common place among application developers.
I'm pretty sure that a large part of the user base of these tools has no
clue "stack" exists, even, and the only reason why they can install
these programs is because their distributions package manager allows
then to do so without exposing them to any Haskell-specific build tools.
> Furthermore, distributions do not install using cabal or from Hackage.
They do install from Hackage, just not using cabal-install.
When using a real package manager, every package's dependencies must be
satisfied simultaneously.
Using stack isolates the developer from
dependency conflicts with other packages during development, but when a
user goes to install it, he doesn't have that luxury.
Just thought of something that might help to deal with dependency nuisance:
What if the top package (in namespace) contained major version?
E.g. Cabal_1_22
below packages might use minor versions - basically, whenever api changes, change the version part of the affected package.
Here by package I mean part of the namespace.
This way, different versions could coexist quite painlessly..
?
[...] What if the top package (in namespace) contained major version?
E.g. Cabal_1_22
below packages might use minor versions - basically, whenever api changes, change the version part of the affected package. [...]
> As a developer, what should I import if my program/library works with e.g. the version range [1.20 .. 1.23]?
maybe change only that part of the namespace where api changed?
also, why not publish less frequently? I mean, nothing stops anyone
from making frequent changes to a library, but why not limit number
of versions released to public?
> In the exporting library? In the importing library?
Well, in both places. Basically, similar part of namespace guarantees that api is the same below.
If api (or code) changed, then it will lead to a different result.
As consumer of a library, you'd refer to exactly the version you used while developing. This exact same version would be pulled in alongside other versions of the same library, used in other parts of a large app.
It may lead to code duplication and larger binaries however it would essentially give you a sandbox with very little effort.
>> also, why not publish less frequently?
> Could you explain this in more detail, please? I don't seem to understand what you're proposing... :-/
Well, let's say I am working on a library. Tempting as it is to release the first draft, I'd first use this fresh library in a few places, catch some bugs, fix them, and then release.
Because this takes time, this library would see very few releases per year.
It would be less likely to cause multiple version conflict.
Here is an allegory:
There is Toyota 1985 and Toyota 2010.
Although they both are Toyotas, they may be very different cars.
ads show cars by brand, model and year, because brand alone is rarely enough.
So why not spell this out in code? Why dump this task on tools which can not really tell what importing code actually requires?
> In the exporting library? In the importing library?
Well, in both places. Basically, similar part of namespace guarantees that api is the same below.
[...] This exact same version would be pulled in alongside other versions of the same library, used in other parts of a large app.
It may lead to code duplication and larger binaries however it would essentially give you a sandbox with very little effort.
Well, let's say I am working on a library. Tempting as it is to release the first draft, I'd first use this fresh library in a few places, catch some bugs, fix them, and then release.
Because this takes time, this library would see very few releases per year.
It would be less likely to cause multiple version conflict.
Well let's think of books vs tweets.
Books:
take longer to write
are written to last for at least a couple years
are expected to be read by a number of readers, over time
are planned
are structured / organized
cover a few topics in depth
are reviewed
are proof read
some books become out of date
may contain errata
There are different editions. There is usually time span between them. Sometimes authors change title between editions.
There are different books about similar topics.
Tweets are in several ways just the opposite of books.
I like to think of software libraries as books. Good libraries are like hardcover editions.