TyThing(..), DFunId, TypeEnv, isTyClThing, Avails,
WhatsImported(..), GenAvailInfo(..),
ImportVersion, AvailInfo, Deprecations(..),
- Finder, ModuleLocation(..)
+ ModuleLocation(..)
)
import CmdLineOpts
import SrcLoc ( noSrcLoc )
import Outputable
import Module ( ModuleName, moduleName )
+import Finder ( findModule )
import List ( partition )
import IO ( IOMode(..), openFile, hClose )
%************************************************************************
\begin{code}
-writeIface :: Finder -> Maybe ModIface -> IO ()
-writeIface finder Nothing
+writeIface :: FilePath -> Maybe ModIface -> IO ()
+writeIface hi_path Nothing
= return ()
-writeIface finder (Just mod_iface)
- = do { maybe_found <- finder mod_name ;
- ; case maybe_found of {
- Nothing -> printErrs (text "Can't write interface file for" <+> ppr mod_name) ;
- Just (_, locn) ->
-
- do { let filename = hi_file locn
- ; if_hdl <- openFile filename WriteMode
+writeIface hi_path (Just mod_iface)
+ = do { if_hdl <- openFile hi_path WriteMode
; printForIface if_hdl (pprIface mod_iface)
; hClose if_hdl
- }}}
- where
- mod_name = moduleName (mi_module mod_iface)
+ }
pprIface :: ModIface -> SDoc
pprIface iface