3 ms·
Tao's effects are nominally typed, so there's no way to accidentally mix them up in the way I assume you're describing. For example: # Define a new effect
by zesterer 4y ago
Tao's effects are nominally typed, so there's no way to accidentally mix them up in the way I assume you're describing. For example:
# Define a new effect that yields to the caller
effect yield A = A => ()
# A generator that emits numbers
def one_two_three : yield Nat ~ () = {
yield(1)!;
yield(2)!;
yield(3)!;
}
# Print the numbers to the console
def main : io ~ () = {
one_two_three
handle yield Nat with n => print(n->show)!
}