curry.toolchain.flat2icurry.casecompletion module
Case completion, the second pass. It follows FlatCurry.CaseCompletion
of the Curry package icurry.
Every case over constructors is rewritten so that its branches follow the
constructor order of the data declaration. A missing constructor c of
arity n gets the branch c 101 .. 100+n -> Prelude.failed. A case
over literals is left as it is. The data declarations come from the module
and from the interfaces of its imports.
- curry.toolchain.flat2icurry.casecompletion.complete_exp(datadecls, e)[source]
Completes every case in an expression. The walk runs on a stack of its own (
utility.trampoline.trampoline()), so a nested application of any depth needs no recursion (issue #125).
- curry.toolchain.flat2icurry.casecompletion.complete_prog(datadecls, prog)[source]
Completes every case in a program.