<div dir="ltr">Hello,<div><br></div><div style>I am having a problem with (re)compiling some code I have. I have two modules A and B. In A I have some classes and instances and B uses this. When I try to compile B (with cabal or ghc --make) the first time everything works. When I now modify B (add a space) B is recompiled but the compiler hangs and doesn&#39;t seems to be doing anything.</div>

<div style><br></div><div style>I have tested the problem with GHC (x86_64) 7.6.2. 7.6.3 and HEAD.</div><div style><br></div><div style>It seems to be very similar to a problem I had earlier: <a href="http://hackage.haskell.org/trac/ghc/ticket/7321">http://hackage.haskell.org/trac/ghc/ticket/7321</a></div>

<div style>but this time there are no GADTs involved.</div><div style><br></div><div style>The code of module A (clutter that doesn&#39;t contribute to the problem has been removed):</div><div style><br></div><div style>
<div>
&gt; {-# LANGUAGE FlexibleInstances, UndecidableInstances     #-}</div><div>&gt; {-# LANGUAGE GADTs                 #-}</div><div>&gt; {-# LANGUAGE MultiParamTypeClasses #-}</div><div>&gt; {-# LANGUAGE TypeFamilies, TypeOperators, ScopedTypeVariables #-}</div>

<div>&gt; {-# LANGUAGE FlexibleContexts #-}</div><div>&gt; {-# LANGUAGE DataKinds, PolyKinds #-}</div><div>&gt; <br></div><div>&gt; module A where</div><div>&gt; <br></div><div>&gt; import GHC.Generics</div><div>&gt; <br>

</div><div>&gt; class QA a where</div><div>&gt;   type QRep a</div><div>&gt;  type QRep a = QRep (GRep (Rep a))</div><div>&gt; <br></div><div>&gt; instance QA () where<br></div><div>&gt;   type QRep () = ()</div><div>&gt; <br>

</div><div>&gt; -- Kind-polymorphic proxies;<br></div><div>&gt; data Pr (a :: k) = Pr<br></div><div>&gt; <br></div><div>&gt; class (QA (GRep f)) =&gt; CaseOf (f :: * -&gt; *) where</div><div>&gt;     type Alg f r k :: *</div>

<div>&gt;     type GRep f :: *</div><div>&gt; <br></div><div>&gt; -- Only used for the product structure</div><div>&gt; class QA (ProdRep f) =&gt; CaseOfProd (f :: * -&gt; *) where</div><div>&gt;   type ProdAlg f r :: *</div>

<div>&gt;   type ProdRep f :: *</div><div><br></div><div style>The code of module B:</div><div style><div><br></div><div>&gt; module B where</div><div>&gt; import qualified A<br></div><div><br></div><div style>Given that the code type checks (and if I do not recompile and make an executable directly it actually works) I think this is a bug that might be similar to the bug mentioned in ticket 7321. </div>

<div style><br></div><div style>Does anybody recognise the problem? Should I create a ticket?</div><div style><br></div><div style>Cheers,</div><div style><br></div><div style>Jeroen Weijers</div></div></div></div>