Change dependency resolution algorithm.
Change dependency resolution algorithm.

There were two reasons to do this.  Firstly, this formulation makes it
easier to add the --constraint command line flag that adds additional
constraints on the packages that should be used.

Secondly, with the orgininal algorithm it was possible to satisfy the
constraint "foo < 1, foo > 2" if we had two versions of package "foo"
which each satisfy one constraint.  This patch fixes this by requiring
the same package to satisfy both constraints (which of course is
impossible in this case).

thomie/cabal,beni55/cabal,garetxe/cabal,thoughtpolice/cabal,fugyk/cabal,Helkafen/cabal,rimmington/cabal,corngood/cabal,typelead/epm,plumlife/cabal,lukexi/cabal,Peaker/cabal,enolan/cabal,mmakowski/cabal,fpco/cabal,valderman/cabal,Helkafen/cabal,thomie/cabal,bennofs/cabal,kosmikus/cabal,ian-ross/cabal,triplepointfive/cabal,randen/cabal,kosmikus/cabal,typelead/epm,randen/cabal,alphaHeavy/cabal,Heather/cabal,alphaHeavy/cabal,trskop/cabal,bennofs/cabal,themoritz/cabal,Peaker/cabal,plumlife/cabal,mightybyte/cabal,martinvlk/cabal,plow-technologies/cabal,garetxe/cabal,mydaum/cabal,anton-dessiatov/cabal,x-y-z/cabal,ghc-android/cabal,mightybyte/cabal,edsko/cabal,Heather/cabal,trskop/cabal,triplepointfive/cabal,gridaphobe/cabal,headprogrammingczar/cabal,lukexi/cabal,kolmodin/cabal,gbaz/cabal,christiaanb/cabal,gbaz/cabal,anton-dessiatov/cabal,ian-ross/cabal,plow-technologies/cabal,mmakowski/cabal,x-y-z/cabal,beni55/cabal,sopvop/cabal,themoritz/cabal,martinvlk/cabal,headprogrammingczar/cabal,seereason/cabal,corngood/cabal,rimmington/cabal,ghc-android/cabal,fugyk/cabal,themoritz/cabal,sopvop/cabal,kolmodin/cabal,edsko/cabal,fpco/cabal,eric-stanley/cabal,eric-stanley/cabal,gridaphobe/cabal,enolan/cabal,christiaanb/cabal,mydaum/cabal,seereason/cabal,sopvop/cabal,valderman/cabal,thoughtpolice/cabal