From 863d31b38fb83e8cabb2734d733fd60fe569f703 Mon Sep 17 00:00:00 2001 From: Evan Czaplicki Date: Sat, 4 Jan 2014 09:45:20 +0100 Subject: [PATCH] Switch name of qualified import --- compiler/Type/Constrain/Declaration.hs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/compiler/Type/Constrain/Declaration.hs b/compiler/Type/Constrain/Declaration.hs index 99e7107..683fbb0 100644 --- a/compiler/Type/Constrain/Declaration.hs +++ b/compiler/Type/Constrain/Declaration.hs @@ -2,15 +2,15 @@ module Type.Constrain.Declaration where import SourceSyntax.Declaration -import qualified SourceSyntax.Expression as Src +import qualified SourceSyntax.Expression as E import qualified SourceSyntax.Location as L import qualified SourceSyntax.Pattern as P import qualified SourceSyntax.Type as Type -toExpr :: [Declaration] -> [Src.Def] +toExpr :: [Declaration] -> [E.Def] toExpr = concatMap toDefs -toDefs :: Declaration -> [Src.Def] +toDefs :: Declaration -> [E.Def] toDefs decl = case decl of Definition def -> [def] @@ -20,7 +20,7 @@ toDefs decl = toDefs' (ctor, tipes) = let vars = take (length tipes) arguments tbody = Type.Data name $ map Type.Var tvars - body = L.none . Src.Data ctor $ map (L.none . Src.Var) vars + body = L.none . E.Data ctor $ map (L.none . E.Var) vars in [ definition ctor (buildFunction body vars) (foldr Type.Lambda tbody tipes) ] TypeAlias name _ tipe@(Type.Record fields ext) _ -> @@ -30,13 +30,13 @@ toDefs decl = Type.EmptyRecord -> map snd fields _ -> map snd fields ++ [ext] - var = L.none . Src.Var + var = L.none . E.Var vars = take (length args) arguments efields = zip (map fst fields) (map var vars) record = case ext of - Type.EmptyRecord -> L.none $ Src.Record efields - _ -> foldl (\r (f,v) -> L.none $ Src.Insert r f v) (var $ last vars) efields + Type.EmptyRecord -> L.none $ E.Record efields + _ -> foldl (\r (f,v) -> L.none $ E.Insert r f v) (var $ last vars) efields -- Type aliases must be added to an extended equality dictionary, -- but they do not require any basic constraints. @@ -56,9 +56,9 @@ toDefs decl = arguments :: [String] arguments = map (:[]) ['a'..'z'] ++ map (\n -> "_" ++ show (n :: Int)) [1..] -buildFunction :: Src.LExpr -> [String] -> Src.LExpr +buildFunction :: E.LExpr -> [String] -> E.LExpr buildFunction body@(L.L s _) vars = - foldr (\p e -> L.L s (Src.Lambda p e)) body (map P.PVar vars) + foldr (\p e -> L.L s (E.Lambda p e)) body (map P.PVar vars) -definition :: String -> Src.LExpr -> Type.Type -> Src.Def -definition name expr tipe = Src.Definition (P.PVar name) expr (Just tipe) \ No newline at end of file +definition :: String -> E.LExpr -> Type.Type -> E.Def +definition name expr tipe = E.Definition (P.PVar name) expr (Just tipe) \ No newline at end of file