HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Moduleghc-9.14.1GHC2021

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
  • Packageghc-9.14.1
  • Exports6
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceHeader.hs
valuegetImports
  1. :: ParserOpts

    Parser options

  2. -> Bool

    Implicit Prelude?

  3. -> StringBuffer

    Parse this.

  4. -> FilePath

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

  5. -> FilePath

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

  6. -> 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.