on master help sign in
Clean up Transform/Replace.hs. Switch the environment from a (String -> String) to a (Map String String).
98eceb5Evan Czaplicki
compiler/Transform/Replace.hs+3−2
@@ -33,9 +33,10 @@ patternVars :: Pattern -> Set String
33patternVars pattern =
33patternVars pattern =
34 case pattern of
34 case pattern of
35 PData _ ps -> unions (map patternVars ps)
35 PData _ ps -> unions (map patternVars ps)
36− PVar x -> singleton x
36+ PVar x -> singleton x
37 PAsVar x p -> insert x (patternVars p)
37 PAsVar x p -> insert x (patternVars p)
38− PAnything -> empty
38+ PAnything -> empty
39+ PLiteral _ -> empty
39
40
40depth :: Expr -> Integer
41depth :: Expr -> Integer
41depth = depth' 0
42depth = depth' 0