Add getImports, a useful interface to the .hi file parser

This commit is contained in:
Don Stewart 2005-07-04 03:23:30 +00:00
parent 62b6e31734
commit 20e08f523a

View File

@ -46,6 +46,8 @@ module System.Plugins.Load (
, Symbol , Symbol
, getImports
) where ) where
import System.Plugins.Make ( build ) import System.Plugins.Make ( build )
@ -629,6 +631,14 @@ loadDepends obj incpaths = do
moduleDeps <- mapM (\(hi,m) -> loadObject m (Object hi)) mods'' moduleDeps <- mapM (\(hi,m) -> loadObject m (Object hi)) mods''
return (hiface,moduleDeps) return (hiface,moduleDeps)
-- ---------------------------------------------------------------------
-- Nice interface to .hi parser
--
getImports :: String -> IO [String]
getImports m = do
hi <- readIface (m ++ hiSuf)
return $ dep_mods (mi_deps hi)
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- C interface -- C interface
-- --