In addition to the standard types in Verse, there are some additional constructs that can be used the way you would use a type, but that technically are not types. void is one such construct.
When used as the result of a function, it indicates that the function can return any value, but when invoked, it will provide no particular result of interest.
Void takes any value and returns false. This allows the body of a function that returns void to implicitly yield any value, without having to be careful to convert the result of any last expression in a block.
For example:
Foo() : void = {}This means that Foo will succeed, but will not return a value.
For example:
FirstInt(X:int, :void) : int = XTechnically, void can be thought of as a function defined as
void(:any) : trueWhen used as a type, you can think of it as being applied to whatever is assigned to the corresponding typed identifier.
Using a function in a type position is only allowed for a void function. Functions used in this way are known as functors.