fix: record type syntax from '=' to ':'#280
Conversation
Updated syntax for record type notation.
|
Hello @BruceEckel :-) And thank you for your contribution. Changes auto-deploy every hour. |
|
I submitted that before I read the rest of https://doc.flix.dev/records.html, and started encountering that syntax everywhere. I assumed it was an error because everywhere else a colon is used to indicate a type, so this looked out of place. But then I tried taking another example further down in the doc: And "fixing" it to what I assumed it should be: And this did not work. So my submission was incorrect and it should be reverted. Since this special-case style of type definition is counterintuitive, I'm guessing you had a reason for doing it, perhaps to make named parameters work? |
|
Ah yes, I was too fast. Indeed the syntax is: |
This reverts commit 87d67e3.
|
The reason is that but also |
|
I've been working through the docs and so far this is the only thing I've found that I'd say violates the principles of least surprise and consistency. I understand you had some reason for making that choice and that it cannot be changed at this point. However, because it is surprising it would be helpful for the reader to point it out, explicitly say that it's inconsistent and explain why (in particular, why ':' could not have been used here and the principles were forced to be violated, etc.), at the first point it appears. That will reduce the surprise. |
Updated syntax for record type notation.