Open mtshiba opened 1 year ago
I've added a function perform
to the unsound
module. This allows you to circumvent Erg effect analysis.
print x =
unsound.perform do! print! x
print "hello"
This is similar to isolate
, but it is more powerful and unsound. It can execute non-localized procedures.
Consider a procedure like this.
This procedure has no "external" side effects, aside from being able to be rewritten in the FP side-effect-free style. The side effects are completely localized internally. We want to be able to treat this as a function.
So, I propose the following
isolate
function.Localized
trait means the procedure is completely localized and has no external influence.sum!
can be converted intosum
using theisolate
function as follows.