-
-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Labels
Description
Hi, Do you plan to have type aliases?
The other day I wrote this signature:
fun seq(ps : Array(Function(Array(t), Result(Tuple(String, Array(t)), Tuple(String, Array(t)))))) {
Instead I'd like to write something like
type ParseErr(t) = Tuple(String, Array(t))
type ParseOk(t) = Tuple(String, Array(t))
type Production(t) = Function(Array(t), Result(ParseErr(t), ParseOk(t)))
fun seq(ps : Array(Production(t))) {
or without type parameters and with module scoping
type Grammar.ParseErr = Tuple(String, Array(Token))
type Grammar.ParseOk = Tuple(String, Array(Token))
type Grammar.Production = Function(Array(Token), Result(Grammar.ParseErr, Grammar.ParseOk))
module Grammar {
fun seq(ps : Array(Grammar.Production)) {
Sija, joshua-obritsch, Namek, farism and yb66