This module contains an implementation of case completion, i.e.,
all case expressions occurring in a FlatCurry program are completed
(with calls to Prelude.failed
) and ordered according to the
constructor ordering of the corresponding data definitions.
Author: Michael Hanus
Version: January 2020
typeOfConstructor
:: CaseOptions -> (String,String) -> ((String,String),[((String,String),Int)])
|
completeProg
:: CaseOptions -> Prog -> Prog
Complete all nested cases in a FlatCurry program. |
completeFun
:: CaseOptions -> FuncDecl -> FuncDecl
Complete all nested cases in a FlatCurry function. |
completeRule
:: CaseOptions -> Rule -> Rule
|
completeExp
:: CaseOptions -> Expr -> Expr
|
allConsProg
:: Prog -> [(String,String)]
Get all constructors occurring in case expressions in a FlatCurry program. |
allConsFun
:: FuncDecl -> [(String,String)]
AllCons all nested cases in a FlatCurry function. |
allConsExp
:: Expr -> [(String,String)]
|
unionMap
:: Eq a => (b -> [a]) -> [b] -> [a]
|
dataDeclsOf
:: Prog -> [((String,String),[((String,String),Int)])]
Get all data types (pairs of type name and list of constructor names and arities) in a given FlatCurry program. |
Type to represent algebraic data declarations (pair of type name and list of constructor names and arities).
Type synonym: DataDecl = (QName,[(QName,Int)])
Options for case completion.
Constructors:
|
Complete all nested cases in a FlatCurry program. |
Complete all nested cases in a FlatCurry function. |
|
|
Get all constructors occurring in case expressions in a FlatCurry program. |
AllCons all nested cases in a FlatCurry function. |
|
|
Get all data types (pairs of type name and list of constructor names and arities) in a given FlatCurry program. |