In practice I&#39;ve found that working with Tagged is a huge pain relative to working with Proxy.<div><br></div><div>You usually need to use ScopedTypeVariables or do asTypeOf/asArgOf tricks that are far more complicated than they need to be.</div>
<div><br></div><div>For reference you can compare the internals of reflection before when it used to use Tagged, and after I switched it to use Proxy.</div><div><br></div><div>The Proxy version is much simpler.</div><div>
<br></div><div>Tagged works well when you only need one tag and are going to use it for a lot of types. That really isn&#39;t the usecase with Typeable most of the time.</div><div><div><br></div><div>-Edward<br><br><div class="gmail_quote">
On Fri, Feb 10, 2012 at 7:35 PM, Bas van Dijk <span dir="ltr">&lt;<a href="mailto:v.dijk.bas@gmail.com">v.dijk.bas@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">On 11 February 2012 00:30, John Meacham &lt;<a href="mailto:john@repetae.net">john@repetae.net</a>&gt; wrote:<br>
&gt; Would it be useful to make &#39;Proxy&#39; an unboxed type itself? so<br>
&gt;<br>
&gt; Proxy :: forall k . k -&gt; #<br>
&gt;<br>
&gt; This would statically ensure that no one accidentally passes ⊥ as a parameter<br>
&gt; or will get anything other than the unit &#39;Proxy&#39; when trying to evaluate it.<br>
&gt; So the compiler can unconditionally elide the parameter at runtime. Pretty<br>
&gt; much exactly how State# gets dropped which has almost the same definition.<br>
<br>
</div>Or don&#39;t use an argument at all:<br>
<br>
class Typeable t where<br>
  typeRep :: Tagged t TypeRep<br>
<br>
newtype Tagged s b = Tagged { unTagged :: b }<br>
<br>
See:<br>
<br>
<a href="http://hackage.haskell.org/packages/archive/tagged/0.2.3.1/doc/html/Data-Tagged.html" target="_blank">http://hackage.haskell.org/packages/archive/tagged/0.2.3.1/doc/html/Data-Tagged.html</a><br>
<font color="#888888"><br>
Bas<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
</div></div></blockquote></div><br></div></div>