Weird Meta-Combinators
I am writing the standard library and I find that there are certain kinds of weird combinators that I would like to have. What makes them weird is that they modify the behaviour of functions passed on the stack.
For example an interesting function would be one which takes any function, executes it, and then pushes the production again. So the type would be:
double_production : (’A (’A -> ‘B) -> ‘B ‘B)
Another one would be one which eliminates the production altogether:
eliminate_production : (’A (’A -> ‘B) -> )
Combining them is interesting:
double_evaluation : (’A ‘A (’A -> ‘B) -> ‘B ‘B)
{ dup [eliminate_production] dip double_production }
These might be possible from the core primitives. I’ll need to do a bit more investigating.