Hmm, strange. I have a project that uses data families with dozens of constructors per &quot;clause&quot;/instantiation of the type function. I use GADT syntax to define them though as they also refine one of the parameter type variables. Never had any issues with it, although I haven&#39;t tried building that project on GHC 7 yet (as some of its dependencies didn&#39;t work last time I tried), so maybe it&#39;s a new issue?<div>
<br><div class="gmail_quote">On Sun, Nov 14, 2010 at 2:15 PM, Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hey all,<br>
<br>
While trying to get a commit pushed for Yesod[1], Alexander Dunlap<br>
pointed out one of his programs didn&#39;t work with the new code. After<br>
some investigation, I was able to reproduce the bug with the following<br>
code snippet:<br>
<br>
{-# LANGUAGE TypeFamilies #-}<br>
data family Foo a<br>
data Bar = Bar<br>
data instance Foo Bar<br>
    = Bar1 | Bar2 | Bar3 | Bar4 | Bar5 | Bar6 | Bar7 | Bar8 | Bar9<br>
    deriving Eq<br>
<br>
This produces:<br>
<br>
    Couldn&#39;t match expected type `Main.R:FooBar&#39;<br>
           against inferred type `Foo Bar&#39;<br>
      NB: `Foo&#39; is a type function<br>
    In the first argument of `Main.$con2tag_R:FooBar&#39;, namely `a&#39;<br>
    In the expression: (Main.$con2tag_R:FooBar a)<br>
    In the expression:<br>
        case (Main.$con2tag_R:FooBar a) of {<br>
          a#<br>
            -&gt; case (Main.$con2tag_R:FooBar b) of {<br>
                 b# -&gt; (a# GHC.Prim.==# b#) } }<br>
<br>
The especially strange thing about this bug is that it only occurs<br>
when there are more than 8 constructors; if I remove Bar9, everything<br>
seems to work. Does anyone have experience with this occuring?<br>
<br>
Michael<br>
<br>
[1] <a href="http://docs.yesodweb.com/blog/please-break-yesod/" target="_blank">http://docs.yesodweb.com/blog/please-break-yesod/</a><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><br></div>