on master help sign in
Add dealiasing for Strings
commit67503cef7ddc3b16462c5a0317b06fd35a358a6c authorevancz <info@elm-lang.org> dateWed 6 Feb 2013, 10:30 (14 years ago) parentb2a7bd1
1 file changed+4−1
elm/src/Types/Substitutions.hs+4−1
elm/src/Types/Substitutions.hs+4−1
@@ -94,8 +94,11 @@ generalize exceptions (Forall xs cs t) = rescheme (Forall (xs ++ frees) cs t)
9494dealias :: [Statement] -> [Statement]
9595dealias stmts = map dealiasS stmts
9696 where
97+ builtins :: [(String,([X],Type))]
98+ builtins = [ ("String", ([], string)) ]
99+
97100 getAliases :: [Statement] -> Map.Map String ([X],Type)
98− getAliases stmts = Map.fromList (concatMap getAlias stmts)
101+ getAliases stmts = Map.fromList (builtins ++ concatMap getAlias stmts)
99102 where getAlias stmt = case stmt of
100103 TypeAlias alias xs t -> [(alias, (xs,t))]
101104 _ -> []