
On Jul 7, 2014, at 9:58 AM, Kazu Yamamoto (山本和彦)
Hi Yuras,
Thank you for your reply.
I'm 90% sure you have MonadIO and RWST imported from different versions of transformers. Try to load the code into ghci and check ':i MonadIO' and ':i RWST'. If you'll see fully qualified (including package name and version) names somewhere, then that is the issue. See also http://stackoverflow.com/questions/11068272/acid-state-monadstate-instance-f...
Yes. Probably MonadIO belongs to transformers 0.3.0.0 while RWST does to transformers 0.4.1.0.
My question is why this happens. I think that GHCi should use RWST provided by transformers 0.3.0.0.
I think GHC always picks the package with the highest version number, and does _not_ resolve to the package that gives the least amount of type errors. The "Loading package transformers-0.3.0.0" is not there due to your own use of transformers. It's being loaded because it is a dependency of 'ghc-7.8.2'. Also note that this behaviour is not specific to 7.8.*, it is also present in 7.6.3. The only thing you can to with both version of transformers installed is to just do:
ghci -package ghc -hide-package transformers-0.4.1.0 A.hs
-- Christiaan