Last active
November 10, 2023 17:41
-
-
Save LukasPietzschmann/86b2c90d2fe904a9e2fad3e8faf84e03 to your computer and use it in GitHub Desktop.
A possible definition of foldAST for exercise A f)
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
foldAST :: (Name -> Op -> Name -> a) -> (Name -> a) -> ([Argument] -> a -> a) -> AST -> a | |
foldAST fb fv ff = f | |
where f (BinExpr n1 o n2) = fb n1 o n2 | |
f (Variable n) = fv n | |
f (Function ps a) = ff ps $ f a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment