The problem is that the representation probably does not reduce to a normal form.<div><br class="webkit-block-placeholder"></div><div>Say, for the case</div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-style-span" style="font-style: italic;">type instance F (Nest a) x = Either() (a,F a x)</span></div>
<div><span class="Apple-style-span" style="font-style: italic;"><br class="webkit-block-placeholder"></span></div><div><div><span class="Apple-style-span" style="font-style: italic;">fnn :: F (Nest a) (Nest a)</span></div>
<div><span class="Apple-style-span" style="font-style: italic;">fnn = Left ()</span></div><div><br class="webkit-block-placeholder"></div><div>it compiles ok.</div><div><br class="webkit-block-placeholder"></div><div>But why can&#39;t the representation be infinite, like any other infinite data type?</div>
<div>Cheers,</div><div>hugo</div><div><br class="webkit-block-placeholder"></div><br><div class="gmail_quote">On Mon, Apr 7, 2008 at 10:30 PM, Hugo Pacheco &lt;<a href="mailto:hpacheco@gmail.com">hpacheco@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi guys,<div><br></div><div>I have been experimenting some weird stuff (risky, yes I know) but the behaviour was certainly not the one I expected:</div>
<div><br>
</div><div><span style="font-style:italic">{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}<br></span></div><div><span style="font-style:italic"><br>
</span></div><div><span style="font-style:italic">module Nest where</span></div><div><span style="font-style:italic"><br></span></div>
<div><div><span style="font-style:italic">data Nest a = Nil | Cons a (Nest (a,a))</span></div><div><span style="font-style:italic"><br>
</span></div><div><span style="font-style:italic">type family F a x :: *</span></div><div><div><span style="font-style:italic">type instance F (Nest a) x = Either () (a,F (Nest (a,a)) x)</span></div>
<div><span style="font-style:italic"><br></span></div><div><span style="font-style:italic">fnn :: F (Nest Int) (Nest Int)</span></div><div><span style="font-style:italic">fnn = Left ()</span></div>
<div><br></div><div>The following module fails to compile (or better, compilation never ends).</div><div><br></div><div>Maybe there is something very bad going on due to the undecidable-instances extension?</div>
<div><br></div><div>Any clue?</div><div>hugo</div></div></div>
</blockquote></div><br></div>