flatcurry-addtypes

This packages defines operations to add type information to the body of each function defined in a FlatCurry program.

The type information (see type FlatCurry.AddTypes.TypeInfo) consists of a list of all typed variables visible in an expression and the result type of the expression.

The main operation addTypesInProgWithImports defined in FlatCurry.AddTypes takes the FlatCurry interfaces (or programs) of imported modules and the program to be transformed and returns the type-annotated program (the data types to represent type-annotated programs are also defined in FlatCurry.AddTypes):

addTypesInProgWithImports :: [Prog] -> Prog -> AProg TypeInfo

The imports are necessary to get the types of all constructors and functions accessed in the program. There is also the operation

addTypesInProg :: Prog -> IO (AProg TypeInfo)

which reads the interfaces of the imports before annotating the program.