Module FlatCurry.CaseCompletion

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: March 2021

Summary of exported operations:

typeOfConstructor :: CaseOptions -> (String,String) -> ((String,String),[((String,String),Int)])  Deterministic 
completeProg :: CaseOptions -> Prog -> Prog  Deterministic 
Complete all nested cases in a FlatCurry program.
completeFun :: CaseOptions -> FuncDecl -> FuncDecl  Deterministic 
Complete all nested cases in a FlatCurry function.
completeRule :: CaseOptions -> Rule -> Rule  Deterministic 
completeExp :: CaseOptions -> Expr -> Expr  Deterministic 
allConsProg :: Prog -> [(String,String)]  Deterministic 
Get all constructors occurring in case expressions in a FlatCurry program.
allConsFun :: FuncDecl -> [(String,String)]  Deterministic 
AllCons all nested cases in a FlatCurry function.
allConsExp :: Expr -> [(String,String)]  Deterministic 
unionMap :: Eq a => (b -> [a]) -> [b] -> [a]  Deterministic 
dataDeclsOf :: Prog -> [((String,String),[((String,String),Int)])]  Deterministic 
Get all data types (pairs of type name and list of constructor names and arities) in a given FlatCurry program.

Exported datatypes:


DataDecl

Type to represent algebraic data declarations (pair of type name and list of constructor names and arities).

Type synonym: DataDecl = (QName,[(QName,Int)])


CaseOptions

Options for case completion.

Constructors:


Exported operations:

typeOfConstructor :: CaseOptions -> (String,String) -> ((String,String),[((String,String),Int)])  Deterministic 

completeProg :: CaseOptions -> Prog -> Prog  Deterministic 

Complete all nested cases in a FlatCurry program.

completeFun :: CaseOptions -> FuncDecl -> FuncDecl  Deterministic 

Complete all nested cases in a FlatCurry function.

completeExp :: CaseOptions -> Expr -> Expr  Deterministic 

allConsProg :: Prog -> [(String,String)]  Deterministic 

Get all constructors occurring in case expressions in a FlatCurry program.

allConsFun :: FuncDecl -> [(String,String)]  Deterministic 

AllCons all nested cases in a FlatCurry function.

allConsExp :: Expr -> [(String,String)]  Deterministic 

unionMap :: Eq a => (b -> [a]) -> [b] -> [a]  Deterministic 

dataDeclsOf :: Prog -> [((String,String),[((String,String),Int)])]  Deterministic 

Get all data types (pairs of type name and list of constructor names and arities) in a given FlatCurry program.