Multi-versioning and compatibility classes.

Jason Dusek jason.dusek at
Mon Nov 30 14:28:43 EST 2009

  I have been looking at the Cabal roadmap (tickets marked for
  bottom) and notice that no one has mentioned multi-versioning
  or compatibility classes. Maybe these are bad ideas?

  Multi-versioning seems highly desirable. Essentially, it
  allows us to have the same qualified names be provided by
  different packages for different packages. This is desirable
  in the case of package versions which really are no longer the
  same, like Parsec 2 and Parsec 3; it also allows for the case
  where more than one package specifies the same qualified name
  because it is obvious (like `Text.JSON` or some such). It
  stands to reason that the "package environment" specified in
  the `.cabal` file is enough to tell us which package we really
  need to use.

  However, there are problems, too. Like what if I have one
  package that depends on `parsec-` and another that
  depends on `parsec-`? With multi-versioning, they both
  compile fine but then I try to use a parser from one with a
  combinator defined in the other: this fails to compile


  is not the same as:


  So now we need compatibility classes. The first package might
  specify a package dependency like:


  where we take the `~` to mean "requires something compatible
  with". The second package specifies a similar dependency:


  Then the maintainer of Parsec specifies that is
  compatible with and we can compile the second package,
  the one that require, with since they are
  compatible and that is all it is asking for. Then we try to
  use these two packages together and everything works.

Jason Dusek

More information about the cabal-devel mailing list