<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hello,<br>
      <br>
      Could we perhaps have a better (shorter) name for asProxyTypeOf? I
      ended up with [1] in one of my libraries (hintType2, hintType1Of2,
      hintType2Of2 could also be useful). I would like to suggest adding
      proxy values for standard types (aUnit, aChar, etc in the link) as
      well, should I make a separate proposal (one could imagine a
      special syntax for proxy values, e.g. expr `hintTypeArg` ''Type
      built in the compiler, but that would take years to land...)?<br>
      <br>
      [1]
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <a
href="http://hackage.haskell.org/packages/archive/data-textual/0.1/doc/html/Data-Textual.html#g:3">http://hackage.haskell.org/packages/archive/data-textual/0.1/doc/html/Data-Textual.html#g:3</a><br>
      <br>
      On 07/31/2013 03:35 AM, Edward Kmett wrote:<br>
    </div>
    <blockquote
cite="mid:CAJumaK8Qk7jBbfJEPRbbjnzpXK-PimM1TFYz_xprb8iQt45rfg@mail.gmail.com"
      type="cite">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 'void'</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 "user land" 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'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
                moz-do-not-send="true" 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 moz-do-not-send="true"
                  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'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's there already, and what<br>
                &gt; you<br>
                &gt; think is missing? I'm more than happy to accept
                contributing patches too :-)<br>
                &gt;<br>
                &gt;<br>
                <br>
              </div>
              I'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'm aware of:<br>
              <br>
              * It looks like there's a SafeHaskell issue -- should this
              be marked<br>
              Trustworthy? See <a moz-do-not-send="true"
                href="https://github.com/ekmett/tagged/pull/13"
                target="_blank">https://github.com/ekmett/tagged/pull/13</a><br>
              * tagged's Data.Proxy defines some useful functions that
              aren't<br>
              present in base. Two of them can move into tagged's
              Data.Tagged, but<br>
              the other two should probably go in base'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'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 ()'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 moz-do-not-send="true"
                    href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
                  <a moz-do-not-send="true"
                    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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Libraries mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libraries@haskell.org">Libraries@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://www.haskell.org/mailman/listinfo/libraries">http://www.haskell.org/mailman/listinfo/libraries</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>