Proposal: Redundant Commas

A new proposal Unordered redundant commas is started reviewing by Committee.
So it is time to upvote/downvote in first comment and any other feedback is welcomed.

This topic was discussed over decade and we have 3 groups of opinions where redundant commas could be allowed:

  1. Anything is better then nothing
  2. Everything or nothing
  3. If something, then a simple and obvious rule to distinguish when it is allowed must exists.

This proposal from 3rd group: we allow redundant commas (leading commas, trailing commas and extra commas) in UnOrdered structures:

  • import and export lists and sub-lists
  • deriving and default clauses
  • records

Lists and tuples are not part of Proposal.

15 Likes

If you still didn’t read or vote in first comment for the proposal to allow leading and trailing commas in unordered structures ( export/import lists and sublists, deriving and defaults clauses, records) - you still can do that before Committee make the decission!

1 Like

Ok. My proposal is observed and even upvoted by the Committee.
It is called now “Extra NonTuple Commas”.

But I think this is too broad and maybe “Extra NonData (NonTuple, NonLists, NonRecords) Commas” would be better decision.

But what are you thinking? It is Ok to comment here or in the Proposal pull.
The final decision will come soon! And it is still possible to have some influence on it.

2 Likes

Finally, the proposal was accepted with name ExtraCommas!
This extension allows to use AND leading comma AND trailing commas in most of structures, except tuple-like (tuples, unboxed tuples, constrain tuples) if such structure contains at least 1 item.

This includes

  • export lists and sub-lists

  • import lists and sub-lists

  • deriving clauses

  • list comrehensions

  • literal lists in expressions and patterns

  • records in terms and types (declarations, patterns, constructions)

  • multi-name function signatures including nested fields in records

  • multi-name pattern signatures

  • multi-name type-synonym signatures

  • fixity lists

  • fundeps

  • pragmas

    • COMPLETE
    • DEEPRECATED
    • INLINE
    • NOINLINE
    • LANGUAGE
    • MINIMAL
    • SPECIALIZE
    • SPECIALIZE INLINE
    • WARNING

We all waiting for the implementation!

12 Likes

I’ll implement it tomorrow.

19 Likes

Now available in MicroHs. Always on, like all other extensions.

8 Likes