parseOnlyImports :: String -> IO [String]
parseOnlyImports fullName = do
    contents <- readSourceFile fullName    
    return $ case lexer [] fullName contents of
               Left _ -> []
               Right (toks, _) ->
                 case runHParser onlyImports fullName (layout toks) False {- no EOF -} of
                   Left _ -> []
                   Right imports -> map stringFromImportDeclaration imports

{-
module  
    ->  "module" modid exports? "where" body  
--      |  body  
-}
parseOnlyImports :: String -> IO [String]
parseOnlyImports fullName = do
    contents <- readSourceFile fullName    
    return $ case lexer [] fullName contents of
               Left _ -> []
               Right (toks, _) ->
                 case runHParser onlyImports fullName (layout toks) False {- no EOF -} of
                   Left _ -> []
                   Right imports -> map stringFromImportDeclaration imports

{-
module  
    ->  "module" modid exports? "where" body  
--      |  body  
-}
parseOnlyImports fullName = do
    contents <- readSourceFile fullName    
    return $ case lexer [] fullName contents of
               Left _ -> []
               Right (toks, _) ->
                 case runHParser onlyImports fullName (layout toks) False {- no EOF -} of
                   Left _ -> []
                   Right imports -> map stringFromImportDeclaration imports

{-
module  
    ->  "module" modid exports? "where" body  
--      |  body  
-}