Unable to install Yesod with "double instance declaration"

When I try to install Yesod using the "cabal install yesod" command, I received the following errors:

cabal install rsa Resolving dependencies... Configuring RSA-1.0.6.1... Preprocessing library RSA-1.0.6.1... Preprocessing executables for RSA-1.0.6.1... Building RSA-1.0.6.1... [1 of 1] Compiling Codec.Crypto.RSA ( Codec/Crypto/RSA.hs, dist/build/Codec/Crypto/RSA.o ) Codec/Crypto/RSA.hs:577:10: Duplicate instance declarations: instance Random Word8 -- Defined at Codec/Crypto/RSA.hs:577:10-21 instance Random Word8 -- Defined in System.Random cabal: Error: some packages failed to install: 

RSA lib seems to be in conflict with another library.

Any idea?

My environment: Mac OS X 10.7 GHC 7.0.3

Thanks in advance.

+4
source share
1 answer

The random package started exporting new instances in version 1.0.1.0. One solution would be to conditionally compile an instance of the RSA library only when the random package is a version or a later version; some variations like this should work:

 {-# LANGUAGE CPP #-} #if MIN_VERSION_random(1,0,1) #else instance Random Word8 where ... #endif 

Bonus points if you submit a patch for the RSA maintainer library.

Alternatively, you can ask cabal to use an older version of random .

+5
source

All Articles