Comment by newpavlov
1 year ago
Types usually describe values. Compilers use types to prove various things about possible values, like their size, alignment, valid bit patterns, etc.
Effects describe code. For example, a "panic" effect states that function may trigger panic/exception during its execution. In other words, existence or absence of an effect is a function property. You can view effects as special types which are used only for functions (to be slightly more precise, signature + effects form function type), but you would need to use a slightly more advanced notion of type system which includes subtyping, e.g. function "panic fn(u32) -> u64" can be used in place of "panic io fn(u32) -> u64".
No comments yet
Contribute on Hacker News ↗