@@ -113,17 +113,17 @@ hasValidIBCVersion fp = do
113 Right archive -> do ver <- getEntry 0 "ver" archive
113 Right archive -> do ver <- getEntry 0 "ver" archive
114 return (ver == ibcVersion)
114 return (ver == ibcVersion)
116−data ImpAction = FullLoad | Unhide | NoAction deriving (Eq, Show)
118loadIBC :: Bool -- ^ True = reexport, False = make everything private
117loadIBC :: Bool -- ^ True = reexport, False = make everything private
119 -> IBCPhase
118 -> IBCPhase
120 -> FilePath -> Idris ()
119 -> FilePath -> Idris ()
121loadIBC reexport phase fp
120loadIBC reexport phase fp
122 = do imps <- getImported
121 = do imps <- getImported
123− let action = case lookup fp imps of
122+ case lookup fp imps of
124− Nothing -> FullLoad
123+ Nothing -> load True
125− Just p -> if (not p && reexport) then Unhide else NoAction
124+ Just p -> if (not p && reexport) then load False else return ()
126− when (action /= NoAction) $ do
125+ where
127 logIBC 1 $ "Loading ibc " ++ fp ++ " " ++ show reexport
127 logIBC 1 $ "Loading ibc " ++ fp ++ " " ++ show reexport
128 archiveFile <- runIO $ B.readFile fp
128 archiveFile <- runIO $ B.readFile fp
129 case toArchiveOrFail archiveFile of
129 case toArchiveOrFail archiveFile of
@@ -131,14 +131,10 @@ loadIBC reexport phase fp
131 ifail $ fp ++ " isn't loadable, it may have an old ibc format.\n"
131 ifail $ fp ++ " isn't loadable, it may have an old ibc format.\n"
132 ++ "Please clean and rebuild it."
132 ++ "Please clean and rebuild it."
133 Right archive -> do
133 Right archive -> do
134− case action of
134+ if fullLoad
136− process reexport phase archive fp
135+ then process reexport phase archive fp
137− addImported reexport fp
139− unhide phase archive
136+ else unhide phase archive
140− addImported reexport fp
137+ addImported reexport fp
143-- | Load an entire package from its index file
139-- | Load an entire package from its index file
144loadPkgIndex :: String -> Idris ()
140loadPkgIndex :: String -> Idris ()