Created
February 16, 2010 15:56
-
-
Save dublindan/305609 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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