<p dir="ltr">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.<br>

See also  <a href="http://stackoverflow.com/questions/11068272/acid-state-monadstate-instance-for-update">http://stackoverflow.com/questions/11068272/acid-state-monadstate-instance-for-update</a><br>
</p>
<div class="gmail_quote">07.07.2014 6:19 пользователь "Kazu Yamamoto" <<a href="mailto:kazu@iij.ad.jp">kazu@iij.ad.jp</a>> написал:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi cafe,<br>
<br>
I noticed that strange behavior of GHC 7.8.2. Consider the following<br>
example which requires the "ghc" package:<br>
<br>
----<br>
{-# LANGUAGE GeneralizedNewtypeDeriving #-}<br>
<br>
module A where<br>
<br>
import GHC<br>
import MonadUtils<br>
import Control.Monad.Trans.RWS.Lazy (RWST(..))<br>
<br>
newtype M a = M (RWST () () () IO a)<br>
              deriving (Functor,Applicative,Monad,MonadIO)<br>
----<br>
<br>
The "ghc" library depends on "transformers" 0.3.0.0. If "transformers"<br>
*0.4.1.0* is NOT installed, GHCi can handle the code above well:<br>
<br>
----<br>
% ghci -package ghc A.hs<br>
...<br>
Loading package transformers-0.3.0.0 ... linking ... done.<br>
...<br>
Ok, modules loaded: A.<br>
[*A]<br>
><br>
----<br>
<br>
However, if "transformers" *0.4.1.0* is installed, an error happens:<br>
<br>
----<br>
% cabal install transformers<br>
% ghci -package ghc A.hs<br>
...<br>
Loading package transformers-0.3.0.0 ... linking ... done.<br>
...<br>
[1 of 1] Compiling A                ( A.hs, interpreted )<br>
<br>
A.hs:10:49:<br>
    No instance for (MonadIO (RWST () () () IO))<br>
      arising from the 'deriving' clause of a data type declaration<br>
    Possible fix:<br>
      use a standalone 'deriving instance' declaration,<br>
        so you can specify the instance context yourself<br>
    When deriving the instance for (MonadIO M)<br>
Failed, modules loaded: none.<br>
[Prelude]<br>
><br>
----<br>
<br>
A you can see, "transformers" 0.3.0.0 is certainly linked.<br>
How can I interpret this behavior?<br>
<br>
If this is a bug of GHC 7.8.2, I will file this to GHC's trac.<br>
<br>
P.S.<br>
<br>
We noticed this because "doctest" of ghc-mod fails only for GHC 7.8.2.<br>
<br>
--Kazu<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div>