I would really want to keep <font face="courier new, monospace">asProxyTypeOf</font> around as it is commonly used and has no other plausible home within tagged. <div><br></div><div><font face="courier new, monospace">reproxy</font> is quite negotiable.<div>
<br></div><div>Ever since its signature was generalized a version or two ago in tagged, it has started to feel quite silly.</div><div><br></div><div>If I move</div><div><font face="courier new, monospace"><br></font></div>
<div><font face="courier new, monospace">coerce :: (Functor f, Contravariant f) =&gt; f a -&gt; f b</font></div><div><font face="courier new, monospace">coerce = contramap absurd . fmap absurd </font><font face="times new roman, serif">-- using absurd from &#39;void&#39;</font><br>
<font face="times new roman, serif">-- or equivalently:  </font><font face="courier new, monospace">coerce = contramap (const ()) . fmap (const ())</font><br><br>from lens up into the contravariant package, then the role that function plays can be replaced entirely with that more general purpose combinator in &quot;user land&quot; without needing any funny looking functions in base.</div>
<div><br></div><div>Proxy is both Contravariant and a normal covariant Functor as it doesn&#39;t use its argument, just like Const m. reproxy originally witnessed this fact just for Proxy, but that fact in its broader generality has since been exploited to make getters and folds in lens, so reproxy is basically just residue of an old approach.</div>
<div><br></div><div>-Edward<br><br><div class="gmail_quote">On Tue, Jul 30, 2013 at 6:44 PM, Shachaf Ben-Kiki <span dir="ltr">&lt;<a href="mailto:shachaf@gmail.com" target="_blank">shachaf@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 Mon, Jul 22, 2013 at 1:23 AM, José Pedro Magalhães &lt;<a href="mailto:jpm@cs.uu.nl">jpm@cs.uu.nl</a>&gt; wrote:<br>

&gt; Thanks for bringing this up again. This was started in my data-proxy branch<br>
&gt; of base,<br>
&gt; but never really finished. We definitely want to have this in 7.8, and I<br>
&gt; think there&#39;s<br>
&gt; only some minor finishing work to do (check if we have all the instances we<br>
&gt; want,<br>
&gt; document, etc.). Perhaps you can look through what&#39;s there already, and what<br>
&gt; you<br>
&gt; think is missing? I&#39;m more than happy to accept contributing patches too :-)<br>
&gt;<br>
&gt;<br>
<br>
</div>I&#39;m looking at the current state of Data.Proxy in base (it looks like<br>
Richard merged data-proxy into master) and it looks pretty good<br>
instance-wise. Issues I&#39;m aware of:<br>
<br>
* It looks like there&#39;s a SafeHaskell issue -- should this be marked<br>
Trustworthy? See <a href="https://github.com/ekmett/tagged/pull/13" target="_blank">https://github.com/ekmett/tagged/pull/13</a><br>
* tagged&#39;s Data.Proxy defines some useful functions that aren&#39;t<br>
present in base. Two of them can move into tagged&#39;s Data.Tagged, but<br>
the other two should probably go in base&#39;s Data.Proxy. In particular<br>
<br>
asProxyTypeOf :: a -&gt; proxy a -&gt; a<br>
asProxyTypeOf = const<br>
<br>
reproxy :: proxy s -&gt; Proxy t<br>
reproxy _ = Proxy<br>
<br>
When these are fixed, tagged can probably shuffle a couple of<br>
functions around and then use base&#39;s Data.Proxy rather than exporting<br>
its own module (for GHC ≥ 7.7).<br>
<br>
(By the way: Some instances are slightly different from what GHC would<br>
derive -- e.g. «_ == _ = True» is different from «Proxy == Proxy =<br>
True», which is ()&#39;s Eq behavior. I think this is OK but I wanted to<br>
mention it.)<br>
<br>
Thanks,<br>
<div class="HOEnZb"><div class="h5">    Shachaf<br>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div></div>