Last active
December 21, 2019 00:18
-
-
Save 3v0k4/3ecafce8eb3519122cfd7a16017ee59a 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
input :: String | |
input = | |
"add 1 sub 6 add 3 2" | |
main :: Effect Unit | |
main = do | |
logShow $ runParser astParser input | |
-- (Right (Add 1 (Sub 6 (Add 3 2)))) | |
logShow $ map generate $ runParser astParser input | |
-- (Right "(1 + (6 - (3 + 2)))") | |
logShow $ map evaluate $ runParser astParser input | |
-- (Right 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment