[ghc-steering-committee] #536: Type-level literals as a separate language extension, rec: accept

Simon Peyton Jones simon.peytonjones at gmail.com
Mon Mar 6 16:15:10 UTC 2023


I'm content to accept this one.

Simon

On Mon, 6 Mar 2023 at 13:05, Vladislav Zavialov <vlad.z.4096 at gmail.com>
wrote:

> Dear Committee,
>
> Ross Paterson has proposed #536 "Type-level literals as a separate
> language extension". Read it here:
>
>
> https://github.com/RossPaterson/ghc-proposals/blob/literals/proposals/0000-type-level-literals.rst
>
> Currently the DataKinds extension allows us to use both type-level
> literals (such as "hello", 'x', and 42) and promoted algebraic data
> constructors (such as True, Just, and '[]). The proposal is to factor out
> promotion of literals into its own extension, TypeLevelLiterals.
>
> Why would one want to enable TypeLevelLiterals but not DataKinds? Because
> the latter can create ambiguities when it comes to name resolution. If the
> user defines `data Just x = ...` and they have DataKinds enabled, then
> suddenly it's ambiguous whether `Just` refers to a data constructor or a
> type constructor, and GHC starts to guess from context. Type-level
> literals, on the other hand, are a more conservative subset of DataKinds
> that does not raise any questions with regards to name resolution.
>
> While I, personally, would not use this conservative subset, I believe we
> shouldn't create obstacles for those who want to. I expect the maintenance
> costs to be minimal.
>
> Does anyone have objections? If not, I will mark the proposal accepted in
> 2 weeks.
>
> - Vlad
> _______________________________________________
> ghc-steering-committee mailing list
> ghc-steering-committee at haskell.org
> https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20230306/9e01110e/attachment.html>


More information about the ghc-steering-committee mailing list