From 20e08f523a0b4fa98be4917b395fc2c1df30a376 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Mon, 4 Jul 2005 03:23:30 +0000 Subject: [PATCH] Add getImports, a useful interface to the .hi file parser --- src/plugins/System/Plugins/Load.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/System/Plugins/Load.hs b/src/plugins/System/Plugins/Load.hs index ab6236f..887e044 100644 --- a/src/plugins/System/Plugins/Load.hs +++ b/src/plugins/System/Plugins/Load.hs @@ -46,6 +46,8 @@ module System.Plugins.Load ( , Symbol + , getImports + ) where import System.Plugins.Make ( build ) @@ -629,6 +631,14 @@ loadDepends obj incpaths = do moduleDeps <- mapM (\(hi,m) -> loadObject m (Object hi)) mods'' 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 --