raulraja
01/12/2018, 7:19 PMdef
for fun
😉karelpeeters
01/12/2018, 7:20 PMI can't really handle typingall the time 😞.fun
raulraja
01/12/2018, 7:30 PMpure 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 = {
println("boom!")
0
} // compiles because the effect is controled by a function
karelpeeters
01/12/2018, 7:35 PMraulraja
01/12/2018, 7:43 PMRuckus
01/12/2018, 7:46 PMraulraja
01/12/2018, 7:47 PM