Okay so I've been down a rabbit hole (no pun intended) trying to figure out exactly where effect systems and algebraic effects sit relative to the rest of type theory. Like, is an effect system "just" a fancier type system? Is it fundamentally different? How do algebraic effect handlers relate to monads? I have so many questions and I figured this forum is exactly the right place to ask uwu
Let me start with what I think I know: an effect system is typically an extension of a type system โ the term "type and effect system" is sometimes used in this case. So at the most basic level, effects aren't a completely separate beast โ they live inside (or on top of) the type system.
In computing, an effect system is a formal system that describes the computational effects of computer programs, such as side effects, and can be used to provide a compile-time check of the possible effects of the program.
But then you have algebraic effects specifically, which feel much richer than just "tagging types with what they do." Algebraic effects are computational effects that can be described with a set of basic operations and equations between them. The algebraic structure is the key thing here โ you're not just annotating, you're giving the effects an equational theory.
And then on top of that you get effect handlers, which is where things get really wild. Algebraic effect handlers have been steadily gaining attention as a programming language feature since they generalise many control-flow abstractions such as exception handling, iterators, async/await, or backtracking, while ensuring that the composition of various features remains well-behaved.
The big question in my mind: how do you situate all of this in the "type theory zoo"? We have:
Simple type systemsโ STLC, System F, etc.Dependent typesโ Coq, Agda, LeanLinear/modal typesโ substructural, resource trackingEffect systemsโ ??? (monadic? algebraic? row-polymorphic?)Graded/coeffect typesโ ??? (related to the above??)
Are these all orthogonal dimensions? Do they form a hierarchy? Are there languages that combine all of them? Halp ๐พ