So if a suspend function with side effects is pure, but its invocation is not, is that not also true of a non-suspending function with side effects?
r
raulraja
05/18/2019, 12:16 PM
as long as it returns a function. The difference is that suspended functions are automatically tracked by the compiler as effects and you can't run them unless in the presence of continuation which is exactly what IO does.
raulraja
05/18/2019, 12:17 PM
so a regular function that performs inside efffect is fine as long as it defers those effects by returning a function that you need to explicitly apply elsewhere
raulraja
05/18/2019, 12:17 PM
that is. Any thing is pure if when invoked produces a value that does not perform the effects but still allows you to perform them somewhere else later