HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-9.10.3GHC2021

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.10.3
  • 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) ([(RawPkgQual, Located ModuleName)], [(RawPkgQual, Located ModuleName)], Bool, 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.