parseMod :: FilePath -> IO (Located (HsModule RdrName))
parseMod srcFile = do
  buf <- hGetStringBuffer srcFile
  let loc = mkRealSrcLoc (mkFastString srcFile) 1 0
  dflags <- runGhc (Just libdir) $ getSessionDynFlags
  case unP Parser.parseModule (mkPState dflags buf loc) of
    POk pst rdrModule       -> return rdrModule
    PFailed srcspan message -> error $ showSDoc dflags message
parseMod :: FilePath -> IO (Located (HsModule RdrName))
parseMod srcFile = do
  buf <- hGetStringBuffer srcFile
  let loc = mkRealSrcLoc (mkFastString srcFile) 1 0
  dflags <- runGhc (Just libdir) $ getSessionDynFlags
  case unP Parser.parseModule (mkPState dflags buf loc) of
    POk pst rdrModule       -> return rdrModule
    PFailed srcspan message -> error $ showSDoc dflags message
parseMod srcFile = do
  buf <- hGetStringBuffer srcFile
  let loc = mkRealSrcLoc (mkFastString srcFile) 1 0
  dflags <- runGhc (Just libdir) $ getSessionDynFlags
  case unP Parser.parseModule (mkPState dflags buf loc) of
    POk pst rdrModule       -> return rdrModule
    PFailed srcspan message -> error $ showSDoc dflags message