Skip to content

Instantly share code, notes, and snippets.

@dublindan
Created February 16, 2010 15:56
Show Gist options
  • Save dublindan/305609 to your computer and use it in GitHub Desktop.
Save dublindan/305609 to your computer and use it in GitHub Desktop.
fun do-op a b op {
match op
with '+: a + b
with '-: a - b
with '*: a * b
with '/: a / b
with _: error
}
flow gen a b ops -> res {
(do-op a>> b>> ops>>) -> >>res
}
do main {
commit (reduce print
(gen [1 2 3]
[3 2 1]
['+ '- '*]))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment