Closed rpglover64 closed 10 years ago
Thanks for the report! I don't understand this error though (and I can't reproduce it). force-layout-0.3
provides an instance Fractional (Scalar v) => Default (ForceLayoutOpts v)
which ought to apply here, and diagrams-contrib
now requires force-layout >= 0.3
, so I am not sure what is going on. Can you provide the output of ghc-pkg list
?
Interesting; I'd been installing in a sandbox, so I figured it wouldn't be a problem.
Here's a gist with the cabal install diagrams --dry-run
and the cabal sandbox hc-pkg list
output.
Aha, I figured it out. You have the (old) package data-default-0.4.0
installed in your global package DB for some reason, so it is getting copied into your sandbox when you do cabal sandbox init
. However, force-layout
and other packages require the (new) data-default-class
. After version 0.4, data-default
split out the Default
class into a separate package. So now you have both an old data-default
and the new data-default-class
which both provide a type class called Default
; the error you are seeing is caused by a mismatch between the two different Default
classes.
The best solution would be to unregister data-default-0.4.0
from your global package DB; I can see no good reason for wanting it there anyway. Alternatively, you can unregister it from your sandbox immediately after doing cabal sandbox init
(but then you have to remember to do it every time).
I'm closing this ticket but feel free to add more comments here if you run into trouble/need more help/etc.
Thank you! That... was surprisingly obscure. The reason I had data-default-0.4.0
installed is that the XMonad currently in Debian Jessie depends on it. I upgraded to the Sid packages, which use data-default-0.5.1
.
Unfortunately, unregistering from within the sandbox tries to modify the global package database.
Unfortunately, unregistering from within the sandbox tries to modify the global package database.
Ouch! I didn't know that. That seems like a bug. Anyway, glad you got it to work.
For posterity: I ran into this same issue (Ubuntu 14.04, GHC 7.6), but got it to build using
cabal install diagrams --constraint='data-default >= 0.5.2' --constraint='transformers installed'
data-default-0.5.2
is the first version that depends on data-default-class
; I added the other constraint after cabal
tried to reinstall transformers
.
@byorgey Would it be a good idea to change diagrams-contrib
to depend on data-default >= 0.5.2
?
From what I see, it doesn't build with older versions anyway.
If it doesn't build with older versions, then absolutely we should change the lower bound. On Sep 12, 2014 1:00 AM, "Chris Wong" notifications@github.com wrote:
@byorgey https://github.com/byorgey Would it be a good idea to change diagrams-contrib to depend on data-default >= 0.5.2?
From what I see, it doesn't build with older versions anyway.
— Reply to this email directly or view it on GitHub https://github.com/diagrams/diagrams-contrib/issues/28#issuecomment-55361741 .
I confirm that diagrams-contrib
does not build with data-default-0.5.0
or earlier, and does with 0.5.2
. I've made the change in master
and on Hackage. @lfairy Thanks for reporting!