[Haskell-cafe] Error when installing RSA (for yesod) with GHC 7.2.1
daniel.is.fischer at googlemail.com
Mon Oct 24 23:33:53 CEST 2011
On Monday 24 October 2011, 23:13:32, Yves Parès wrote:
> I'm using GHC 7.2.1 and cabal-install 0.8 (Cabal 18.104.22.168), and when
> "cabal install rsa"
> Apparently it's an instance being declared twice.
> However RSA hackage page states that it compiles under GHC 7.2:
The instance in the rsa package is guarded by a Cabal MIN_VERSION macro:
instance Random Word8 where
randomR (a,b) g = let aI::Int = fromIntegral a
bI::Int = fromIntegral b
(x, g') = randomR (aI, bI) g
in (fromIntegral x, g')
random = randomR (minBound, maxBound)
Unfortunately, that macro was broken in some Cabal versions, among them
22.214.171.124, so the negated check goes wrong (#if !(MIN_...) would work).
[As a quickfix for this package, you could edit the source, but you'll
probably come across more macro problems later.]
Build yourself a new cabal-install.
If you use 7.2.1 for that, the recipe at https://gist.github.com/1169332
tells you what you have to change.
If you have an older ghc still available, the vanilla procedure should work
with that (if you're using the old 6.12.* with the Cabal-126.96.36.199, first
install a later Cabal version, 188.8.131.52 works).
More information about the Haskell-Cafe