We present the first algorithm for reconstructing the types and effects of expressions in the presence of first class procedures in a polymorphic typed language.
Effects are static descriptions of the dynamic behavior of expressions.
Just as a type describes what an expression computes, an effect describes how an expression computes. Types are more complicated to reconstruct in the presence of effects because the algebra of effects induces complex constraints on both effects and types. In this paper we show how to perform reconstruction in the presence of such constraints with a new algorithm called algebraic reconstruction, prove that it is sound and complete, and discuss its practical import.