on master help sign in
Switch name of qualified import
commit863d31b38fb83e8cabb2734d733fd60fe569f703 authorEvan Czaplicki <info@elm-lang.org> dateSat 4 Jan 2014, 09:45 (13 years ago) parent9ff2622
1 file changed+11−11
compiler/Type/Constrain/Declaration.hs+11−11
compiler/Type/Constrain/Declaration.hs+11−11
@@ -2,15 +2,15 @@
22module Type.Constrain.Declaration where
33
44import SourceSyntax.Declaration
5−import qualified SourceSyntax.Expression as Src
5+import qualified SourceSyntax.Expression as E
66import qualified SourceSyntax.Location as L
77import qualified SourceSyntax.Pattern as P
88import qualified SourceSyntax.Type as Type
99
10−toExpr :: [Declaration] -> [Src.Def]
10+toExpr :: [Declaration] -> [E.Def]
1111toExpr = concatMap toDefs
1212
13−toDefs :: Declaration -> [Src.Def]
13+toDefs :: Declaration -> [E.Def]
1414toDefs decl =
1515 case decl of
1616 Definition def -> [def]
@@ -20,7 +20,7 @@ toDefs decl =
2020 toDefs' (ctor, tipes) =
2121 let vars = take (length tipes) arguments
2222 tbody = Type.Data name $ map Type.Var tvars
23− body = L.none . Src.Data ctor $ map (L.none . Src.Var) vars
23+ body = L.none . E.Data ctor $ map (L.none . E.Var) vars
2424 in [ definition ctor (buildFunction body vars) (foldr Type.Lambda tbody tipes) ]
2525
2626 TypeAlias name _ tipe@(Type.Record fields ext) _ ->
@@ -30,13 +30,13 @@ toDefs decl =
3030 Type.EmptyRecord -> map snd fields
3131 _ -> map snd fields ++ [ext]
3232
33− var = L.none . Src.Var
33+ var = L.none . E.Var
3434 vars = take (length args) arguments
3535
3636 efields = zip (map fst fields) (map var vars)
3737 record = case ext of
38− Type.EmptyRecord -> L.none $ Src.Record efields
39− _ -> foldl (\r (f,v) -> L.none $ Src.Insert r f v) (var $ last vars) efields
38+ Type.EmptyRecord -> L.none $ E.Record efields
39+ _ -> foldl (\r (f,v) -> L.none $ E.Insert r f v) (var $ last vars) efields
4040
4141 -- Type aliases must be added to an extended equality dictionary,
4242 -- but they do not require any basic constraints.
@@ -56,9 +56,9 @@ toDefs decl =
5656arguments :: [String]
5757arguments = map (:[]) ['a'..'z'] ++ map (\n -> "_" ++ show (n :: Int)) [1..]
5858
59−buildFunction :: Src.LExpr -> [String] -> Src.LExpr
59+buildFunction :: E.LExpr -> [String] -> E.LExpr
6060buildFunction body@(L.L s _) vars =
61− foldr (\p e -> L.L s (Src.Lambda p e)) body (map P.PVar vars)
61+ foldr (\p e -> L.L s (E.Lambda p e)) body (map P.PVar vars)
6262
63−definition :: String -> Src.LExpr -> Type.Type -> Src.Def
64−definition name expr tipe = Src.Definition (P.PVar name) expr (Just tipe)
63+definition :: String -> E.LExpr -> Type.Type -> E.Def
64+definition name expr tipe = E.Definition (P.PVar name) expr (Just tipe)