Infix operator (:||) for NonEmptyList cons'
Description of the change
Motivation for this change is to give users a more ergonomic alternative to: https://github.com/purescript/purescript-lists/blob/6d8e30eeb9714bc422b6fb75ad1b0f43bef59703/src/Data/List.purs#L619-L620
We can currently do a little better with NonEmpty's :| operator:
(NonEmptyList (1 :| 3 : Nil)) : (NonEmptyList (2 :| Nil)) : (NonEmptyList (4 :| Nil)) : (NonEmptyList (3 :| (3 : Nil))) : Nil
But it's even nicer with this change, which introduces the :|| operator for cons'.
(1 :|| 3 : Nil) : (2 :|| Nil) : (4 :|| Nil) : (3 :|| 3 : Nil) : Nil
I'd ideally like to reuse the :| operator, but that leads to complications since we then can't use that operator for pattern matching anymore (it's equivalent to NonEmptyList (NonEmpty x xs). The new version is no longer a simple data constructor of 2 arguments. We'd likely need to enable Pattern Synonyms for that to work.
Checklist:
- [ ] Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
- [ ] Linked any existing issues or proposals that this pull request should close
- [ ] Updated or added relevant documentation
- [ ] Added a test for the contribution (if applicable)
Adding this would be non-breaking so I'd suggest leaving this until after v0.14.0.
@hdgarrood Why wait to merge this if it builds and is otherwise acceptable?
Because we should be focusing on getting v0.14.0 out - it's been in the pipeline for far too long already.
What is the current status of this proposal? It is planned to be merged?