Some goodies to deal with type-annotated FlatCurry programs.
Author: Michael Hanus
Version: August 2020
unionTAProg
:: AProg TypeExpr -> AProg TypeExpr -> AProg TypeExpr
Returns the union of two typed FlatCurry programs. |
funcsOfFuncDecl
:: AFuncDecl TypeExpr -> [(String,String)]
Returns the names of all functions/constructors occurring in the body of a function declaration. |
ndExpr
:: AExpr TypeExpr -> Bool
Returns True
if the expression is non-deterministic,
i.e., if Or
or Free
occurs in the expression.
|
ppTAExpr
:: AExpr TypeExpr -> String
Pretty prints an expression. |
setAnnPattern
:: TypeExpr -> APattern TypeExpr -> APattern TypeExpr
Sets the top annotation of a pattern. |
etaExpandFuncDecl
:: AFuncDecl TypeExpr -> AFuncDecl TypeExpr
Eta-expansion of user-defined function declarations. |
applyExp
:: AExpr TypeExpr -> [AExpr TypeExpr] -> AExpr TypeExpr
Apply arguments to a given FlatCurry expression by transforming this expression whenever possible. |
dropArgTypes
:: Int -> TypeExpr -> TypeExpr
Remove the given number of argument types from a (nested) functional type. |
isBaseType
:: TypeExpr -> Bool
Is the type expression a base type? |
matchType
:: TypeExpr -> TypeExpr -> Maybe (FM Int TypeExpr)
Compute type matching, i.e., if matchType t1 t2 = s , then t2 = s(t1) .
|
matchTypes
:: [TypeExpr] -> [TypeExpr] -> Maybe (FM Int TypeExpr)
|
pre
:: String -> (String,String)
Transform name into Prelude-qualified name. |
Returns the union of two typed FlatCurry programs. |
Returns the names of all functions/constructors occurring in the body of a function declaration. |
Returns |
Sets the top annotation of a pattern.
|
Eta-expansion of user-defined function declarations. |
Apply arguments to a given FlatCurry expression by transforming this expression whenever possible. |
Remove the given number of argument types from a (nested) functional type. |
Is the type expression a base type?
|
Compute type matching, i.e., if |
|
Transform name into Prelude-qualified name.
|