carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
http://docs.carbon-lang.dev/
Other
32.32k stars 1.48k forks source link

Repeated 'fnty' in curried function types #188

Open gribozavr opened 3 years ago

gribozavr commented 3 years ago

According to the grammar in the basic syntax proposal (#162) it seems like curried function types require repeating the fnty keyword:

expression:  "fnty" tuple return_type
return_type:  "->" expression

For example:

fnty (Int) -> Int // OK
fnty (Int) -> fnty (Int) -> Int // repeated fnty
fnty (Int) -> (Int) -> Int // desired

I understand why it happens, and I see that it is uniform with regards to the expression production, but the result -- repeated fnty keywords -- does not seem aesthetically pleasing to me.

jonmeow commented 3 years ago

Note, "Should there be a function type? #191" may supersede this issue.

jsiek commented 3 years ago

This issue with repeated fnty a good observation. Certainly a disadvantage of the current syntax.

github-actions[bot] commented 3 years ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the inactive label. The long term label can also be added for issues which are expected to take time. This issue is labeled inactive because the last activity was over 90 days ago.