Verse supports giving a type another name that can be used to refer to the same underlying type. This is known as a type alias. The syntax is similar to constant initialization as it is basically the same thing, but using types instead of values.
For example, to give an alias to float the following syntax could be used:
number := float
You can use this to shorten some type signatures. For example, instead of the code below,
RotateInts(X : tuple(int, int, int)) : tuple(int, int, int) =
( X(3), X(1), X(2))
an alias could be introduced for tuple, like this:
int_triple := tuple(int, int, int)
RotateInts(X : int_triple) : int_triple =
(X(3), X(1), X(2))
This is particularly useful in combination with function types. For example,
int_predicate := type{_(:int)<transacts><decides> : void}
Filter(X : []int, F : int_predicate) : []int =
for (Y : X, F[Y]):
Y
Note that Verse does not currently support parametric type aliases.
For example,
predicate(t : type) := type{_(:t)<transacts><decides> : void}
is not supported.