Why is NoExt inhabited?

Spiwack, Arnaud arnaud.spiwack at tweag.io
Tue Jun 25 06:59:09 UTC 2019


NoFExt (“Field”) and NoCExt (“Constructor”), maybe?

On Tue, Jun 25, 2019 at 5:22 AM Richard Eisenberg <rae at richarde.dev> wrote:

> I forget if I'm the contributor Ben mentions below, but regardless: NoExt
> is used in two separate ways within GHC. It's used both as the extension of
> a sum (new constructor) and the extension of a product (new field in a
> constructor). But the identity for sum is different than the identity for
> products. To me, it makes good sense for the NoExt used as a product
> extension (new field) to have the 1 trivial inhabitant (thus forming the
> identity for products), but the NoExt used as a sum extension (new
> constructor) to have 0 inhabitants (thus forming the identity for sums).
> Clearly, one of these will need a new name.
>
> Thanks,
> Richard
>
> > On Jun 24, 2019, at 4:57 PM, Ben Gamari <ben at smart-cactus.org> wrote:
> >
> > Hi Shayan,
> >
> > During code review a contributor asked about a TTG extension point.
> > While answering his question I realized I didn't have a good explanation
> > for why NoExt is inhabited; as far as I can tell it should rather be
> > unhabited.
> >
> > If there is a reason for this then can you:
> >
> > 1. describe why this is so in #16863 [1]
> > 2. open an MR documenting the reason in Note [Trees that Grow].
> >
> > If not, perhaps we should consider changing it; the current state of
> > things is a bit awkward.
> >
> > Cheers,
> >
> > - Ben
> >
> >
> > [1] https://gitlab.haskell.org/ghc/ghc/issues/16863
> > _______________________________________________
> > ghc-devs mailing list
> > ghc-devs at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
> _______________________________________________
> 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/20190625/0dadf019/attachment.html>


More information about the ghc-devs mailing list