Alternative to isTypeLevPoly

Sam Derbyshire sam.derbyshire at gmail.com
Wed Sep 14 16:44:26 UTC 2022


Hmm, that's strange, both isTypeLevPoly and typeHasFixedRuntimeRep have the
same precondition: the kind of the type is of the form TYPE rep. So they
should panic in the same circumstances. Can you give a bit more
information? What panics are you running into?

On Wed, 14 Sept 2022 at 18:40, Csaba Hruska <csaba.hruska at gmail.com> wrote:

> Hi,
> Thanks for the tip, I've tried it and it behaves differently than
> isTypeLevPoly. I can get panic when querying the reptype for fixed
> reptypes. That means isTypeLevPoly semantically is not the same as the
> negated result of typeHasFixedRuntimeRep.
>
> On Wed, 14 Sep 2022, 18:19 Sam Derbyshire, <sam.derbyshire at gmail.com>
> wrote:
>
>> Hi Csaba,
>>
>> I think you want the function typeHasFixedRuntimeRep from GHC.Core.Type.
>>
>> Best,
>>
>> Sam
>>
>> On Wed, 14 Sept 2022 at 18:12, Csaba Hruska <csaba.hruska at gmail.com>
>> wrote:
>>
>>> Hello GHC Devs,
>>>
>>> I've noticed that the `isTypeLevPoly` function has been removed from GHC
>>> since 9.4.
>>> I used it to decide the validity of querying the representation type of
>>> every value in the STG IR.
>>> It was mandatory to prevent GHC panics, because there are a lot of
>>> partial functions in GHC.
>>> Is there an alternative to `isTypeLevPoly` in GHC 9.4?
>>>
>>> Best regards,
>>> Csaba Hruska
>>> _______________________________________________
>>> ghc-devs mailing list
>>> ghc-devs at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20220914/1246a6e3/attachment.html>


More information about the ghc-devs mailing list