Today when I tried to compile my code in Geany I got this error
Could not find module `Control.Monad.Reader':
it was found in multiple packages: monads-fd-0.1.0.1 mtl-1.1.0.2
Compilation failed.
I get the same for the Writer monad; I thought I should remove one of those packages, but I do not want to break other packages, so now what should I do, yesterday everything worked without any problem.
It looks like you have recently installed monads-fd
, perhaps as a dependency of something else you installed. Both monads-fd
and mtl
packages contain the module Control.Monad.Reader
, so GHC doesn't know which one to use when you compile some code that imports it. You need to resolve the ambiguity somehow:
-hide-package <package>
flag on the command line to hide one of the packages, orghc-pkg hide <package>
. You may need to use ghc-pkg --user hide <package>
if the package was installed in your home directory (the default on some platforms).build-depends
field in your .cabal
fileIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With