Mapping from a more formal effect system to ours:
- Let fn:E() be a function with effects E
- Assume an effect lattice: pure -> impure -> unsafe
- fn foo(...) declares a function with effects impure
- pure fn foo() declares a functon with effects defined as follows: - let each argument of closure type have an effect variable: x: fn:X() - the effect of foo() is sum(X for all X) - if no closure arguments, the effect is pure
- calling a function with type fn:X() has the effect X