By the way, here's what an
argmunger looks like in Arc:
(def argmunge (munger victim) (fn args (apply victim (map args munger)))) It's used like so:
arc> ((argmunge '(1 0) cons) 'x 'y)
(y . x)
arc> ((argmunge '(2 3 1 1 0 3 2) list) 'a 'b 'c 'd 'e 'f 'g)
(c d b b a d c)That took a couple of minutes to write, and worked first time. Sw33t! Though I
(
Read more... )
Comments 2
I've been wishing to bring up operads as a semantic tool for CS for quite some time now - it seems that things like the highly functional programming languages would benefit deeply from getting described with something like an operad of functions - in these things like flip and (argmunge . permutation) would just be the "obvious" way to thread in a symmetric structure.
Reply
Operads and/or multicategories are a pretty natural approach to semantics and APIs in general, I think.
Reply
Leave a comment