| ▲ | Guvante an hour ago | |
I haven't seen any algebraic effects system that is that powerful The closest is linear types but even then drop isn't an effect but also a function you can call to allow not continuing the references | ||
| ▲ | Tazerenix 27 minutes ago | parent [-] | |
Yeah I should have phrased that better. The traits themselves are not the effects, they're bits of code which can have side effects. Rust doesn't track those side effects in the type system yet, but !Forget especially is the essence of that idea. If you implement it for everything owned by a function, you can basically infer that the function does not have the leak effect (which would be an effect in the effect row of a Forget trait implementstjon). If you try treat memory as an effect you gain the need for several polymorphic effect type functions drop, forget, etc which map a type to the effect row charged by its corresponding Drop, Forget impl. Rust doesn't have that type system obviously. | ||