Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created January 20, 2017 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/0bef28374152c5a729833e9376d0440b to your computer and use it in GitHub Desktop.
Save deque-blog/0bef28374152c5a729833e9376d0440b to your computer and use it in GitHub Desktop.
replaceKnownVars :: Env -> ExprR Expr -> Expr
replaceKnownVars env = go where
go e@(Var v) =
case Map.lookup v env of
Just val -> cst val
Nothing -> Fix e
go e = Fix e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment