Pacific Software Research Center; Portland State University & Oregon Graduate Institute; Dept. of Computer Science
P.S.U., P.O. Box 751, Portland, OR 97207, USA
We describe a type system and typed semantics that use a hierarchy of monads to describe and delimit a variety of effects, including non-termination, exceptions, and state, in a call-by-value functional language. The type system and semantics can be used to organize and justify avariety of optimizing transformations in the presence of effects. In addition, we describe a simple monad inferencing algorithm that computes the minimum effect for each subexpression of a program, and provides more accurate effects information than local syntactic methods.