3 ms·
This is a big breakthrough. You're getting multiple correct programs from a single expression by "instantiating" it over multiple formal Categories. Implement
by carapace 8y ago
This is a big breakthrough. You're getting multiple correct programs from a single expression by "instantiating" it over multiple formal Categories. Implementing new categories is pretty easy.
It can be seen as a generalization of monads and "semiring programming".
I kinda backed into this while writing a type-inferencer for Joy PL[1] (Joy expressions are already in point-free form.) The inferencer and the interpreter wound up being very similar, and I realized I had effectively implemented two categories (kinda): the interpreter evaluates a Joy expression in the Cat of values, while the inferencer evaluates the same expression in a Cat of stack effect descriptions.
So the same Joy expression computes values or infers types depending on which interpreter/category you choose to run it over. And, again, implementing a new category is brief and easy.
[1] http://joypy.osdn.io/notebooks/Types.html#hybrid-inferencer-interpreter http://joypy.osdn.io/notebooks/Types.html#hybrid-inferencer-...