Last active
January 29, 2017 14:30
-
-
Save deque-blog/17549e6b4a28fb2b7fc70a79b4c5fdc6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
expression e = add({ | |
cst(1), | |
cst(2), | |
mul({cst(0), var("x"), var("y")}), | |
mul({cst(1), var("y"), cst(2)}), | |
add({cst(0), var("x")}) | |
}); | |
std::cout << cata<std::string>(print_alg, e) << '\n'; | |
//Will output: | |
"(+ 1 2 (* 0 x y) (* 1 y 2) (+ 0 x))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment