-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type Constructor Syntax #7
Comments
Assuming you use parentheses for something else, I would favor either Java or Scala style. |
If we use Other than those points, it might just be a subjective preference between Java and Scala style. |
I think we can stick with the Java way, although the Haskell syntax is more concise. |
@keean wrote:
I stated that I think Haskell's syntax for that would be confusing to mainstream of programmers and maybe has similar issues as to why I argued for explicit parenthesis for function calls.
Also TypeScript uses the Java style and it is currently the most popular typed language targeting JavaScript. |
@keean if ever you feel you would rather create a more Haskell-like syntax, then please don't be shy to tell me. I am hoping we can agree on the design. But if ever we can't, it is better to know than let it fester unstated. Ditto other readers in the potential community of the future of the language. I know you've stated that you understand the importance of mainstream understanding on the syntax choices. You also seem to have maybe just a tad bit of saudade over not adopting more of Haskell's syntax. I noticed another comment from you that seemed to be exhibiting that? |
Okay I think that's agreed. If we wanted a recursive expression type it would be written something like:
We can also make the expression type parametric on the type of the expression like this:
I like Rust too :-) I think its going well, and I like the decisions we have made so far . |
@keean wrote:
Cross-referencing for readers, I had agreed on that syntax already. |
Ah yes, I had forgotten about those issues with angle brackets which are treated as 'less than' and 'greater than' in some contexts and yes the breakage of not escaping to HTML entity But that HTML breakage applies to any code that has a 'less than' symbol as well. So I eliminate that as a valid differentiated concern. And UIs not treating them as angle brackets when the file extension is a programming language, seems to be sort of worrying about the fringes of possible concerns? We'll probably have many issues on the fringes that we can't make perfect. I am thinking in terms of priorities. |
Why is the title of this issue, "Type Constructor Syntax"? What does that mean? It seems the OP is about type parameter syntax. |
The type-consructor is the bit like |
I think this is decided, will reopen if there are further issues. |
@keean please add a label for the resolution thus far. "Accepted" or "Decided"? |
Yes, I am on my mobile at the moment and can't see how to do it. Will mark when I get home. Is accepted or decided better? |
For consistency, "Accepted" seems adequate to me. A proposal was put forward to choose a syntax analogous to a proposal being put forward to choose a better name than TraitScript. This proposal was decided and accepted. |
@keean wrote:
Ah, you are referring to kinds? Edit: now I remember my confusion. The type parameter syntax might also apply to functions (if we don't choose my proposed less verbose type parameter syntax for functions), not just to kinds. So it seems the title of the Issue is incorrect. You could edit it, to make it more clear it about type parameter declaration, not something about kinds. Then again, if we adopt my less verbose type parameter syntax for functions, then your title ends up more or less correct. |
@shelby3 wrote:
On further thought, you could use "Decided" to differentiate reason for issue closure when the discussion was not a proposal that could be denied, but rather a discussion that could only be closed upon mutual community agreement. For example, when we eventually close the "Subtyping" Issue #8. |
Reminding to attach a label "Decided" to this closed Issue. |
There are four obvious options:
Java style:
Add<a, a>
Scala style:
Add[a, a]
Haskell style:
Add a a
Prolog style:
Add(a, a)
Which option should we go for?
The text was updated successfully, but these errors were encountered: