Hi,<br><br>When migrating some code with type families to GHC 6.10, I frequently get the same error.<br><br>The deal is. If I define some type family and instance:<br><br><i>type family Rep (f :: * -&gt; *) x :: *<br><br>data (g :+: h) x&nbsp;&nbsp;&nbsp; = Inl (g x) | Inr (h x)<br>
type instance Rep (g :+: h) x = Rep g x `Either` Rep h x</i><br><br>and then define a function that has a scoped argument:<br><br><i>test :: Rep (g :+: h) x -&gt; y<br>test (Left x :: Rep (g :+: h) x) = undefined</i><br><br>
I get the error:<br><br><b>&nbsp;Pattern signature must exactly match: Rep (g :+: h) x<br>&nbsp;&nbsp;&nbsp; In the pattern: Left x :: Rep (g :+: h) x<br>&nbsp;&nbsp;&nbsp; In the definition of `test&#39;:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test (Left x :: Rep (g :+: h) x) = undefined</b><br>
<br>Is this error expected? At least the error message is not clear...<br><br>Interestingly, when experimenting with a different functor, I get the impossible:<br><i><br>newtype Const t x&nbsp;&nbsp; = Const {unConst :: t}<br>type instance Rep (Const t) x = t</i><b><br>
<br></b><i>test2 :: Rep (Const t) x -&gt; y<br>test2 x = undefined</i><br><br><b>ghc: panic! (the &#39;impossible&#39; happened)<br>&nbsp; (GHC version 6.10.1 for i386-unknown-linux):<br>&nbsp;&nbsp;&nbsp; readFilledBox x{tv aoB} [box]<br>Please report this as a GHC bug:&nbsp; <a href="http://www.haskell.org/ghc/reportabug">http://www.haskell.org/ghc/reportabug</a><br>
&gt; </b><br><br clear="all">Sorry for the extensiveness. Thanks,<br>hugo<br><br>-- <br><a href="http://www.di.uminho.pt/~hpacheco">www.di.uminho.pt/~hpacheco</a><br>