<br><div class="gmail_quote">On Mon, Aug 13, 2012 at 9:55 AM, Dan Burton <span dir="ltr">&lt;<a href="mailto:danburton.email@gmail.com" target="_blank">danburton.email@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="courier new, monospace">Control.Category.Category</font> is pretty much the only type in base that directly benefits from <font face="courier new, monospace">PolyKinds</font> without any code changes, but without enabling the extension there nobody can define categories for kinds other than <font face="courier new, monospace">*</font>, and most interesting categories actually have more exotic kinds.  </blockquote>



<div><br></div></div><div>What, precisely, is the benefit of turning on PolyKinds for that file without changing the code? If we&#39;re cpp&#39;ing it in, then are there further benefits that we could also reap by cpp&#39;ing some code changes?</div>
</blockquote><div><br></div><div>The benefit is that the kind of Category changes to</div><div><br></div><div>Category :: (x -&gt; x -&gt; *) -&gt; Constraint </div><div><br></div><div>This means I can do things like make</div>
<div><br></div><div>data Dict p where</div><div>   Dict :: p =&gt; Dict p</div><div><br></div><div>newtype a |- b = Sub (a =&gt; Dict b)</div><div><br></div><div>and then</div><div><br></div><div>(|-) :: Constraint -&gt; Constraint -&gt; *</div>
<div><br></div><div>is a valid candidate to become a Category.</div><div><br></div><div>Moreover, PolyKinds + DataKinds finally enable us to write product and sum categories, make categories for natural transformations, and generally finally put Category to work. These were all disallowed by the previous simpler kind.</div>
<div><br></div><div>No code changes need be applied beyond permitting the type of Category to generalize and existing code continues to work.</div><div><br></div><div>This change actually could have been applied in 7.4.1.</div>
<div><br></div><div>-Edward Kmett</div><div><br></div></div>