Quantcast

Is mkTrApp unsafe?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is mkTrApp unsafe?

Andrew Martin
I've been playing around with the GHC 8.2 release candidate. In
Type.Reflection.Unsafe, there's a really handy function named mkTrApp.
Everything else in that module is pretty evidently unsafe, but I'm not
so sure about mkTrApp. I'm wondering if it should actually be exported
by Type.Reflection instead or if I've missed some way it could be used
to create an ill-kinded TypeRep.

-Andrew Martin
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is mkTrApp unsafe?

David Feuer
Yes, I believe you are correct that mkTrApp is safe, and probably
should not be exported by Type.Reflection.Unsafe. However, it's not so
clear to me that it should be exported by Type.Reflection. You should
just be able to use App, both to construct and deconstruct type
applications.

David

On Fri, Apr 14, 2017 at 8:02 PM, Andrew Martin
<[hidden email]> wrote:

> I've been playing around with the GHC 8.2 release candidate. In
> Type.Reflection.Unsafe, there's a really handy function named mkTrApp.
> Everything else in that module is pretty evidently unsafe, but I'm not
> so sure about mkTrApp. I'm wondering if it should actually be exported
> by Type.Reflection instead or if I've missed some way it could be used
> to create an ill-kinded TypeRep.
>
> -Andrew Martin
> _______________________________________________
> Libraries mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is mkTrApp unsafe?

Andrew Martin
Ah, I had never used pattern synonyms before, and I did not really that pattern synonyms could be bidirectional. That's good to know. It seems like mkTrApp should be removed then unless there are any restrictions on partially applying pattern synonyms.

Sent from my iPhone

> On Apr 14, 2017, at 11:51 PM, David Feuer <[hidden email]> wrote:
>
> Yes, I believe you are correct that mkTrApp is safe, and probably
> should not be exported by Type.Reflection.Unsafe. However, it's not so
> clear to me that it should be exported by Type.Reflection. You should
> just be able to use App, both to construct and deconstruct type
> applications.
>
> David
>
> On Fri, Apr 14, 2017 at 8:02 PM, Andrew Martin
> <[hidden email]> wrote:
>> I've been playing around with the GHC 8.2 release candidate. In
>> Type.Reflection.Unsafe, there's a really handy function named mkTrApp.
>> Everything else in that module is pretty evidently unsafe, but I'm not
>> so sure about mkTrApp. I'm wondering if it should actually be exported
>> by Type.Reflection instead or if I've missed some way it could be used
>> to create an ill-kinded TypeRep.
>>
>> -Andrew Martin
>> _______________________________________________
>> Libraries mailing list
>> [hidden email]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Loading...