on master help sign in
cosmetic: remove Type.Alias mess from Build.Print
commite9ecbe1d7b8395f2dc315c422d5af6c14edf2cea authorEvan Czaplicki <info@elm-lang.org> dateWed 4 Jun 2014, 16:40 (12 years ago) parent07907a0
2 files changed+6−17
compiler/Build/File.hs+2−4 compiler/Build/Print.hs+4−13
compiler/Build/File.hs+2−4
@@ -122,9 +122,7 @@ retrieve filePath = do
122122 iface <- liftIO $ Interface.load (Utils.elmi flags filePath)
123123 case Interface.isValid filePath iface of
124124 Right (name, interface) ->
125− do binterfaces <- get
126− let interfaces = snd <$> binterfaces
127− liftIO $ when (Flag.print_types flags) (Print.interfaceTypes interfaces interface)
125+ do liftIO $ when (Flag.print_types flags) (Print.types (Module.iTypes interface))
128126 update name interface False
129127
130128 Left err -> liftIO $ Print.failure err
@@ -148,7 +146,7 @@ compile number filePath =
148146 exitFailure
149147
150148 liftIO $ when (Flag.print_types flags) $ do
151− Print.moduleTypes interfaces canonicalModule
149+ Print.types (Module.types (Module.body canonicalModule))
152150
153151 let newInters = Module.toInterface canonicalModule
154152 generateCache name newInters canonicalModule
compiler/Build/Print.hs+4−13
@@ -5,23 +5,14 @@ import System.Exit (exitFailure)
55
66import qualified Data.Map as Map
77import qualified Data.List as List
8−import qualified AST.Module as M
8+import qualified AST.Module as Module
99import qualified AST.PrettyPrint as Pretty
1010import qualified Text.PrettyPrint as P
1111
12−moduleTypes :: Map.Map String M.Interface -> M.CanonicalModule -> IO ()
13−moduleTypes interfaces modul =
14− types interfaces (M.types body) (M.aliases body) (M.imports modul)
15− where
16− body = M.body modul
17−
18−interfaceTypes :: Map.Map String M.Interface -> M.Interface -> IO ()
19−interfaceTypes interfaces iface =
20− types interfaces (M.iTypes iface) (M.iAliases iface) (M.iImports iface)
21−
22−types interfaces types' aliases imports =
12+types :: Module.Types -> IO ()
13+types ts =
2314 do putStrLn ""
24− mapM_ printType (Map.toList types')
15+ mapM_ printType (Map.toList ts)
2516 putStrLn ""
2617 where
2718 printType (n,t) = do