Reputation: 50486
I see a lot of Haskell packages listed here:
http://hackage.haskell.org/packages/archive/pkg-list.html#cat:database
Are all these packages compatible with each other? If I bring in say 10 packages in order to make a program, are they all going to be OK. What if I brought in all packages listed on the page?
Imagine if you are in Java, in Java if you bring in say 10 jar's from around the web, there maybe dependancies between the JAR's that mean that one JAR requires a version other another JAR that is not a good version for a different JAR. For example, one JAR may need Hibernate version 3.0.0 and another needs Hibernate 2.0.0. So I cannot use these two jars because they don't use a common equal Hibernate version.
Upvotes: 3
Views: 197
Reputation: 76
You have the same problem in Haskell, although as pointed out Cabal is exceptionally smart at resolving dependencies the best way.
Cabal will happily install multiple versions of a package, but that can lead to a subtle error when creating your own: Your package might indirectly depend on multiple versions (Cabal warns you about that when doing configure
), which holds a subtle surprise: When you refer indirectly (e.g. through type inference) to a type, say State, it might be resolved to mtl 1.x at one place and mtl 2.x in another, and the two can't be unified. This becomes a problem when you use two packages and want to combine them in your code. It's seldomly a problem, but it is noteworthy.
Note also that Haskell packages usually depend on a version range instead of a single version. This means that Cabal builds the intersection of accepted versions and uses the newest in it.
Upvotes: 6
Reputation: 28539
No, but
Upvotes: 6