Instead of substituting lambda parameters with fake parameters to generate normal form, we should generate normal forms for lambdas in a format that can also be used as their primary form, e.g. given 2 nested lambdas:
λ %0:0/1 → Applicative3[λ %1:0/3, %1:1/3, %1:2/3 → 0:0/1[1:1, 1:2]]
Current normal forms are:
Applicative3[λ %1:0/3, %1:1/3, %1:2/3 → FAKE_0[1:1, 1:2]
0:0/1[FAKE_0, FAKE_1]
Should be:
Applicative3[λ %1:0/3, %1:1/3, %1:2/3 → 0:0/1[1:1, 1:2]]
-1:0/1[0:1/3, 0:2/3]
Where -1 refers to outer context 1 level up, -2 refers to outer context 2 levels up, etc.
Instead of substituting lambda parameters with fake parameters to generate normal form, we should generate normal forms for lambdas in a format that can also be used as their primary form, e.g. given 2 nested lambdas:
λ %0:0/1 → Applicative3[λ %1:0/3, %1:1/3, %1:2/3 → 0:0/1[1:1, 1:2]]Current normal forms are:
Applicative3[λ %1:0/3, %1:1/3, %1:2/3 → FAKE_0[1:1, 1:2]0:0/1[FAKE_0, FAKE_1]Should be:
Applicative3[λ %1:0/3, %1:1/3, %1:2/3 → 0:0/1[1:1, 1:2]]-1:0/1[0:1/3, 0:2/3]Where -1 refers to outer context 1 level up, -2 refers to outer context 2 levels up, etc.