[ghc-steering-committee] Please review #270: Extend Term-Level Lookup rules
Richard Eisenberg
rae at richarde.dev
Tue Jun 2 08:42:39 UTC 2020
> On Jun 1, 2020, at 7:37 PM, Alejandro Serrano Mena <trupill at gmail.com> wrote:
>
> - I am surprised by the complicated way to introduce that "~" and "[]" are built-in to the language, by means of a new "Data.BuiltinTypes" which is always in scope, unless you disable with another extension. I would be very happy to have those are wired-in types in the language, which cannot be overriden.
Quite separately from the rest of the proposal, this aspect might be seen as a side benefit. When -XStrict was introduced, people asked whether -XStrict made Haskell a strict language. Though it's not the only reason, one "no" answer was justified by the fact that built-in types with privileged syntax (i.e. lists and tuples) are always lazy. By allowing users to define and import/export these types themselves, some users can choose to use strict versions. Note that such a choice would be entirely local to a module, and mediated by familiar import/export of identifiers. Another way to see this: -XRebindableSyntax allows changing the meaning of privileged syntax in terms, but nothing yet allows such a change in types.
If a proposal came along that included only the ability to redefine and import/export built-in types -- without anything else about punning or extending lookup rules -- I would probably be ever-so-slightly against, just because of the annoyance of having to suppress the automatic import (-XNoImplicitBuiltIntTypes, in this proposal). But I think extra benefits of this proposal make rebound types worthwhile, and I also think the rebound types would find uptake in our community independent of the rest of this proposal.
Richard
More information about the ghc-steering-committee
mailing list