Skip to content

Instantly share code, notes, and snippets.

View LukasPietzschmann's full-sized avatar
👻
Buh!

Lukas Pietzschmann LukasPietzschmann

👻
Buh!
View GitHub Profile
@LukasPietzschmann
LukasPietzschmann / foldAST.hs
Last active November 10, 2023 17:41
A possible definition of foldAST for exercise A f)
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