Thoughts on notation for tuples and vector types
Hello ghc developers,
I hope this is the right place to post this, because my thoughts are about language specification, in particular notation. The Haskell2020 committee is inactive, so I'll try it here.
According to this page it seems that Haskell will get native vector types in the future which would be great! Also it would be nice if there would be a non awkward handling of these new types.
In other languages with built-in vector types like matlab or julia there is an easy constructor with brackets. A similar simple notation would be nice to make Haskell more competitive to these languages.
Obviously in Haskell the (,) notation is reserved for tuples and the [,] notation for lists. So here is my idea:
Because curly braces {,} are used in the record syntax and records are isomorphic to tuples, one could argue to also use curly braces for constructing tuples. This could be introduced as the new tuple syntax and the current syntax could be marked as deprecated until the new vector types are finished. Then one could use the (,) notation for the vectors. This would also be a natural choice since this matches the standard mathematical notation.
Please see this issue as a basis for discussion, it's only an idea that came to my mind. Questions that arise to me are:
- Is this useful at all?
- Would this cause any negative side-effects on the language?
- How big would the effect on the library ecosystem be?
- Would such a transition be accepted if there was a long period of time during which old and new tuple-syntax were valid?