stregaml icon indicating copy to clipboard operation
stregaml copied to clipboard

Effects!

Open strega-nil opened this issue 7 years ago • 0 comments

syntax:

effect Yield {
  func yield(Int32);
}
effect IoYield = Yield | Io;

func generate() Yield { ... }
func get_int() Io -> Int32 { ... }
func input_stream() Io | Yield { ... }

func print_all(f: func() Yield) {
  handle (f()) {
    Yield::yield(x) => {
      print(x);
      continue;
    }
    return => {}
  }
}

strega-nil avatar Dec 25 '18 05:12 strega-nil