curry.backends.py.currylib.prelude.apply module

curry.backends.py.currylib.prelude.apply.apply(rts, _0)[source]
curry.backends.py.currylib.prelude.apply.apply_gnf(rts, _0)[source]

Implements ($##). The argument is normalized as by ($!!). When the normalization completed, the step suspends on the free variables of the normal form that have no generator, as the C++ runtime does (applygnf_step in currylib/prelude/apply.cpp). A variable with a binding is gone from the normal form, because N put the binding into the expression; a variable with a generator carries information. So a configuration suspended here waits for a variable that another one can still bind, and ready() releases it then (show x after x =:= (3 ? 4)).

The check runs over the normal form and enters no generator. A check over the argument before its normalization walked the generators of the narrowed variables as well, where the fresh variables of the branches this configuration did not take have no information and never get any, so the step suspended for good on them: scenario (d) of example 21 on the Python backend.

curry.backends.py.currylib.prelude.apply.apply_hnf(rts, _0)[source]

Implements ($!). A free variable is a head normal form: the function is applied to the variable, as PAKCS does (id $! x gives x), where hnf alone suspended on it (issue #112). The C++ runtime does the same (applyhnf_step in currylib/prelude/apply.cpp).

curry.backends.py.currylib.prelude.apply.apply_nf(rts, _0)[source]

Implements ($!!).

curry.backends.py.currylib.prelude.apply.cond(rts, _0)[source]
curry.backends.py.currylib.prelude.apply.ensureNotFree(rts, _0)[source]