Stop disambiguating type parameters from term parameters by capitals
Closed this issue · 2 comments
The current implementation of Zydeco relies on an identifier starting with either uppercase or lowercase to decide whether the parameter lies in type level or term level. It works for now, but since we may want to try out a dependent type system sometime, this is an awful choice because we'll be mixing types and terms, and we shouldn't have assumptions only by the name.
I would suggest using [x]
as an indicator of a parameter being a type parameter, in which case both x
and (x)
will mean term parameters. In addition, the brackets and parentheses support annotation.
With the idea of type-guided elaboration, the proposed brackets are no longer necessary; we just need a better elaborator. As for implementation, now the new zydeco-surface
crate can parse variables regardless of what sort it is, with the downside of having to disambiguate data constructors from variables, since the variables can now be capitalized.
Addressed in the new parser.