new-typeable, new cast?

Shachaf Ben-Kiki shachaf at gmail.com
Wed Jul 31 00:44:52 CEST 2013


On Mon, Jul 22, 2013 at 1:23 AM, José Pedro Magalhães <jpm at cs.uu.nl> wrote:
> Thanks for bringing this up again. This was started in my data-proxy branch
> of base,
> but never really finished. We definitely want to have this in 7.8, and I
> think there's
> only some minor finishing work to do (check if we have all the instances we
> want,
> document, etc.). Perhaps you can look through what's there already, and what
> you
> think is missing? I'm more than happy to accept contributing patches too :-)
>
>

I'm looking at the current state of Data.Proxy in base (it looks like
Richard merged data-proxy into master) and it looks pretty good
instance-wise. Issues I'm aware of:

* It looks like there's a SafeHaskell issue -- should this be marked
Trustworthy? See https://github.com/ekmett/tagged/pull/13
* tagged's Data.Proxy defines some useful functions that aren't
present in base. Two of them can move into tagged's Data.Tagged, but
the other two should probably go in base's Data.Proxy. In particular

asProxyTypeOf :: a -> proxy a -> a
asProxyTypeOf = const

reproxy :: proxy s -> Proxy t
reproxy _ = Proxy

When these are fixed, tagged can probably shuffle a couple of
functions around and then use base's Data.Proxy rather than exporting
its own module (for GHC ≥ 7.7).

(By the way: Some instances are slightly different from what GHC would
derive -- e.g. «_ == _ = True» is different from «Proxy == Proxy =
True», which is ()'s Eq behavior. I think this is OK but I wanted to
mention it.)

Thanks,
    Shachaf




More information about the Libraries mailing list