A Sketch of Complete Type Inference for Functional Programming

Manfred Widera

In Proc. of the International Workshop on Functional and (Constraint) Logic Programming (WFLP 2001) , Report No. 2017, University of Kiel


Abstract

Complete type inference for functional programming is an approach to incorporate static type inference into dynamically typed languages that is based on the following idea: For every program or program expression that can be evaluated without a runtime type error, types denoting all valid input values (in case of functions) and all corresponding output/result values are inferred. A type error is just risen for program expressions that must provably fail for every input. In this work we summarize the presentation of a complete type checker. We motivate that complete type checking consists of a check for every function call whether the input type expected by the function and the type inferred for the argument have common elements. After sketching an algorithm that tests two types for common elements the type inference process is summarized in terms of an abstract interpretation.