A function that does not return directly to its caller has Exit as its return type. The operation error is an example of one which does not return to its caller. Instead, it causes a return to top-level.
n := 0
The function gasp is given return type Exit since it is guaranteed never to return a value to its caller.
gasp(): Exit == free n n := n + 1 error "Oh no!" Function declaration gasp : () -> Exit has been added to workspace.
The return type of half is determined by resolving the types of the two branches of the if.
half(k) == if odd? k then gasp() else k quo 2
Because gasp has the return type Exit, the type of if in half is resolved to be Integer.
Compiling function gasp with type () -> Exit Compiling function half with type PositiveInteger -> Integer
Error signalled from user code in function gasp: Oh no!