Created
January 16, 2017 20:20
-
-
Save deque-blog/ba36610b7ae8edacb2941dfc3dc5ca95 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
partial :: Env -> Expr -> Expr | |
partial env e@(Var v) = | |
case Map.lookup v env of | |
Nothing -> e | |
Just n -> cst n | |
partial env (Op opType xs) = Op opType (map (partial env) xs) | |
partial env e = e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment