aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2008-10-09 23:53:54 +0000
committerDavid Waern <david.waern@gmail.com>2008-10-09 23:53:54 +0000
commit5f0ee262e20f55951eb92a95b2925c0ab78914d8 (patch)
tree12d39a607f1596e51a2de9ff4b983fa09706fdd2 /src/Main.hs
parent9bafa8e19b35faf5470093b5786cda8ee12a37cd (diff)
Interleave typechecking with interface creation
At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces.
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 3d0faa31..dce204d1 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -167,22 +167,18 @@ main = handleTopExceptions $ do
-- get packages supplied with --read-interface
packages <- readInterfaceFiles nameCacheFromGhc (ifacePairs flags)
- -- typecheck argument modules using GHC
- modules <- typecheckFiles fileArgs
-
-- combine the link envs of the external packages into one
let extLinks = Map.unions (map (ifLinkEnv . fst) packages)
- liftIO $ do
-- create the interfaces -- this is the core part of Haddock
- let (interfaces, homeLinks, messages) = createInterfaces modules extLinks flags
- mapM_ putStrLn messages
+ (interfaces, homeLinks) <- createInterfaces fileArgs extLinks flags
- -- render the interfaces
- renderStep packages interfaces
+ liftIO $ do
+ -- render the interfaces
+ renderStep packages interfaces
- -- last but not least, dump the interface file
- dumpInterfaceFile (map toInstalledIface interfaces) homeLinks flags
+ -- last but not least, dump the interface file
+ dumpInterfaceFile (map toInstalledIface interfaces) homeLinks flags
else do
-- get packages supplied with --read-interface