cdiggins.com

January 19, 2007

Weird Meta-Combinators

Filed under: Everything — cdiggins @ 6:44 am

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.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress