If there was a way to do effect control I'd actual...
# language-proposals
r
If there was a way to do effect control I'd actually like something like:
Copy code
pure fun x(): Int = 0 //compiles

pure fun y(): Int { 
  println("boom!")
  return 1
} //does not compile because `println` is an effect.

pure fun z(): () -> Int = {
  effect { println("boom!") }
  0
} // compiles because the effect is controled by a function

val effectFun(): () -> Int = z()

run { effectFun() } //runs and compiles because of explicitness

effectFun()  //fails to compile because had an effect tag and it's not being explicitly executed.
2
4