xmobar-0.15 depends on mtl-2.0.* and needs parsec
All packages that will be broken, depends on parsec.
But parsec is compiled with mtl-2.1.1
To install xmobar, cabal needs to reinstall parsec with mtl-2.0.1.0
Thanks,
Yuras
>
> # cabal install xmobar --dry-run
> Resolving dependencies...
> In order, the following would be installed:
> parsec-3.1.3 (reinstall) changes: mtl-2.1.1 -> 2.0.1.0
> xmobar-0.15 (new package)
> Warning: The following packages are likely to be broken by the reinstalls:
> Best regards,
> José
Possibly, yes, but cabal doesn't know that. It has to make the
conservative assumption that you might use them together and so they'd
better be the same type.
If cabal knew for sure that parsec did not expose types from mtl, then
it'd be fine for it to use parsec built against a different version of
mtl, because there would be no way to end up trying to equate types
from two different package instances.
This is the idea behind private or encapsulated dependencies: we would
declare in .cabal files that our use of some dependency does not "leak
out". But to be clear: this feature has not yet been implemented.
But actually in this case I think parsec does expose the fact that it
uses types from mtl. So it actually would not help here.
Duncan
Usually it leads to "strange" compilation errors.
E.g.
Package A:
data AA = AA String
func0 :: Int -> AA
func0 n = AA $ replicate n "A"
func1 :: AA -> Int
func1 (AA str) = length str
Package B:
import A
func2 :: AA -> Int
func2 aa = func1 + 1
Package C:
import A
import B
func3 :: Int -> Int
func3 n = func2 $ func0 n
If C and B are compiled with different versions of C,
then func3 will not compile. Compiler will say that
AA returned by func0 doesn't match AA expected by func2
More real examples:
http://stackoverflow.com/questions/11068272/acid-state-monadstate-instance-for-update
http://stackoverflow.com/questions/12576817/couldnt-match-expected-type-with-actual-type-error-when-using-codec-bmp/12577025#12577025
>
> Thanks,
> José
Do you have any suggestions to install xmobar in this particular case?
Thanks,
José
--
José António Branquinho de Oliveira Lopes
Instituto Superior Técnico
Technical University of Lisbon
In case of executables I usually rm -rf ~/.ghc, cabal install,
and rm -rf ~/.ghc again. Executables are still here (in ~/.cabal/bin),
but all libraries are lost. Warning: it may break your development
environment, so make sure you know what you are doing.
Better solution could be sandbox tools like cabal-dev. They alloy you to
setup development environment per project.
_______________________________________________