HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Moduleghc-10.0.0.20260917GHC2024

GHC.Parser.Header

Parsing the top of a Haskell source file to get its module name, imports and options.

(c) Simon Marlow 2005 (c) Lemmih 2006

  • 6 values
valuegetImports
  1. :: ParserOpts

    Parser options

  2. -> SourceErrorContext
  3. -> Bool

    Implicit Prelude?

  4. -> StringBuffer

    Parse this.

  5. -> FilePath

    Filename the buffer came from. Used for reporting parse error locations.

  6. -> FilePath

    The original source filename (used for locations in the function result)

  7. -> IO (Either (Messages PsMessage) ([Located ModuleName], [(ImportLevel, RawPkgQual, Located ModuleName)], Located ModuleName))

    The source imports and normal imports (with optional package names from -XPackageImports), and the module name.

#

Parse the imports of a source file.

Throws a SourceError if parsing fails.