@@ -113,17 +113,17 @@ hasValidIBCVersion fp = do
113113 Right archive -> do ver <- getEntry 0 "ver" archive
114114 return (ver == ibcVersion)
115115
116−data ImpAction = FullLoad | Unhide | NoAction deriving (Eq, Show)
117116
118117loadIBC :: Bool -- ^ True = reexport, False = make everything private
119118 -> IBCPhase
120119 -> FilePath -> Idris ()
121120loadIBC reexport phase fp
122121 = do imps <- getImported
123− let action = case lookup fp imps of
124− Nothing -> FullLoad
125− Just p -> if (not p && reexport) then Unhide else NoAction
126− when (action /= NoAction) $ do
122+ case lookup fp imps of
123+ Nothing -> load True
124+ Just p -> if (not p && reexport) then load False else return ()
125+ where
126+ load fullLoad = do
127127 logIBC 1 $ "Loading ibc " ++ fp ++ " " ++ show reexport
128128 archiveFile <- runIO $ B.readFile fp
129129 case toArchiveOrFail archiveFile of
@@ -131,14 +131,10 @@ loadIBC reexport phase fp
131131 ifail $ fp ++ " isn't loadable, it may have an old ibc format.\n"
132132 ++ "Please clean and rebuild it."
133133 Right archive -> do
134− case action of
135− FullLoad -> do
136− process reexport phase archive fp
137− addImported reexport fp
138− Unhide -> do
139− unhide phase archive
140− addImported reexport fp
141− _ -> return ()
134+ if fullLoad
135+ then process reexport phase archive fp
136+ else unhide phase archive
137+ addImported reexport fp
142138
143139-- | Load an entire package from its index file
144140loadPkgIndex :: String -> Idris ()