8 ms·
The point I took from it is that "apply" is normally given by your programming system, and its cases are spread out over your whole program. but there's no reas
by Twisol 6y ago
The point I took from it is that "apply" is normally given by your programming system, and its cases are spread out over your whole program. but there's no reason you can't build your own "apply" on your own function-like type. (The `Expr = Lit Int | Add Expr Expr` type is probably the best-known example.)
Functions happen to be things that your PL provides natively. Defunctionalization is all about capturing a piece of the global `apply` for functions, and translating it into an `apply` on a custom data type.