[ghc-steering-committee] Please review #496: Nothing {}, Shepherd: Eric

Eric Seidel eric at seidel.io
Sun Jun 12 16:19:17 UTC 2022


Dear Committee,

This proposal notes an inconsistency around record wildcard syntax where the wildcard selector/binder cannot be used with nullary record constructors. In other words

```
data Foo = Foo {}

x = Foo {..}
```

is rejected with the error

    Illegal `..' notation for constructor ‘Bar’
      The constructor has no labelled fields

John notes that this is unnecessary friction that also causes grief for code generators.

The proposal is to allow the use of record wildcard syntax with nullary constructors. Notably the proposal suggests allowing wildcard syntax with both nullary *records* and nullary positional data constructors, ie both of the following would be allowed.

```
data Foo = Foo {}
data Foo = Foo

x = Foo {..}
```

I noted on GitHub that this leaves a small asymmetry[1], but I still recommend accepting the proposal as is.

As usual, please discuss the proposal's merits in this thread, and the technical details on GitHub.

[1]: https://github.com/ghc-proposals/ghc-proposals/pull/496#issuecomment-1153221981

Eric

On Mon, May 30, 2022, at 09:28, Joachim Breitner wrote:
> Dear Committee,
>
> Empty records with {}
> have been proposed by John Ericsson
>
>
> https://github.com/ghc-proposals/ghc-proposals/pull/496
> https://github.com/Ericson2314/ghc-proposals/blob/empty-record-wildcards/proposals/0000-empty-record-wildcards.rst
>
> This seems to be about straightening a corner case, so to say. I
> suggest Eric as the shepherd.
>
> Please guide us to a conclusion as outlined in 
> https://github.com/ghc-proposals/ghc-proposals#committee-process
>
> Thanks,
> Joachim
>
>
>
>
>
>
>
> -- 
> Joachim Breitner
>   mail at joachim-breitner.de
>   http://www.joachim-breitner.de/
>
> _______________________________________________
> ghc-steering-committee mailing list
> ghc-steering-committee at haskell.org
> https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee


More information about the ghc-steering-committee mailing list