I’ve been trying to get the Y combinator &c. rendering correctly, and it’s much harder than I though it would be.
My initial idea was to detect when the object above an applicator is a lambda. If so, it can be merged into it:
This worked well for simple cases, like the one above.
But how do we render more complex cases like this?
(The above image was taken from the original paper.)
The issue is with the abstraction on the right: it closes over the outer parameter, so it needs to extend a line over and above the abstraction on the left. To do that, we need to take into account:
- What variables are required by the abstraction, so we know where the lines should lead to;
- The height of all the objects to its left, so the lines can properly detour over them.
That’s what I’m implementing now, and I hope to finish it before the end of this month.