[Haskell-cafe] [ghc-proposals] Allow reserved identifiers as fields ...

Ivan Perez ivanperezdominguez at gmail.com
Thu Dec 26 22:15:00 UTC 2024


>
> On Thu, Dec 26, 2024 at 9:24 AM Jons Mostovojs <jm at memorici.de> wrote:
>>
>>> Dear Ivan,
>>>
>>> I normally don't post, but I got quite scared after reading your
>>> commentary of the proposal.
>>>
>>> However, upon closer inspection, it became evident that it doesn't allow
>>> overriding keywords as your post suggested.
>>>
>>>
>>> (While the changes to *fbind* allow more record constructions
>>> to parse, a construction such as ``C { type = e }}`` or ``C { foo.bar =
>>> e }``
>>> will continue to be rejected during name resolution.)
>>>
>>>
It's literally from the motivating example (bold mine):

@parsonsmatt commented on Jul 22
>
> "This should enable the use of HasField "type" s a instances to be used
> with OverloadedRecordDot -* foo.type.*"


https://github.com/ghc-proposals/ghc-proposals/pull/668#issue-2423570608

https://gitlab.haskell.org/ghc/ghc/-/issues/24174

Both of those seem to indicate that a construction like *foo.type* would be
allowed with that extension on. Not *foo."type"*, but *foo.type*.

Also, I think we should strongly reconsider the choices being made in
language design if anyone is seriously considering that, to avoid having to
write foo.type_ the way to go is to design an extension that would have
people write foo."type"

Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20241226/546fee66/attachment.html>


More information about the Haskell-Cafe mailing list