3 ms·
The first yield is just the effect name. There is a shorthand syntax for effects with only one function, such that you only define the name once: effect ctl yi
by ctenb 3y ago
The first yield is just the effect name. There is a shorthand syntax for effects with only one function, such that you only define the name once:
effect ctl yield( i : int ) : bool
See bottom of this section https://koka-lang.github.io/koka/doc/book.html#sec-handling https://koka-lang.github.io/koka/doc/book.html#sec-handling.
When handling the effect you don't 'define' the name, you implement it. Of course you have to mention the name then, just like e.g. with interface implementations