Restricted sums in BoxedRep

Spiwack, Arnaud arnaud.spiwack at tweag.io
Wed Oct 14 14:29:22 UTC 2020


Ok, I believe get it now,

Let's imagine (to take only the simplest case) that we have a `Nullable# a`
type, such that `Nullable# a = (# (##) | a #)`. What would be the kind of
`Nullable#`? I imagine that it would be something like `TYPE (BoxedRep
Lifted) -> TYPE (BoxedRep Nullable)`.

Then you would want to abstract the type of arrays/tvars/whatnot from `Type
-> Type` to `forall r. TYPE (BoxRep r) -> Type`.

Is that a correct interpretation of your suggestion?

If so, my guess would be that all the above is fine, but I suspect (and I'm
quite a bit out of my comfort zone here) that there can be considerable
difficulties in implementing pattern-matching for such a type.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20201014/be5f44e1/attachment.html>


More information about the ghc-devs mailing list