Why is NoExt inhabited?
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.
> > 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 
> > 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
> >  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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs