From 67503cef7ddc3b16462c5a0317b06fd35a358a6c Mon Sep 17 00:00:00 2001 From: evancz Date: Wed, 6 Feb 2013 10:30:25 -0800 Subject: [PATCH] Add dealiasing for Strings --- elm/src/Types/Substitutions.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/elm/src/Types/Substitutions.hs b/elm/src/Types/Substitutions.hs index 494aa37..4341cd4 100644 --- a/elm/src/Types/Substitutions.hs +++ b/elm/src/Types/Substitutions.hs @@ -94,8 +94,11 @@ generalize exceptions (Forall xs cs t) = rescheme (Forall (xs ++ frees) cs t) dealias :: [Statement] -> [Statement] dealias stmts = map dealiasS stmts where + builtins :: [(String,([X],Type))] + builtins = [ ("String", ([], string)) ] + getAliases :: [Statement] -> Map.Map String ([X],Type) - getAliases stmts = Map.fromList (concatMap getAlias stmts) + getAliases stmts = Map.fromList (builtins ++ concatMap getAlias stmts) where getAlias stmt = case stmt of TypeAlias alias xs t -> [(alias, (xs,t))] _ -> []