HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-exactprint-1.10.0.0Haskell2010

Language.Haskell.GHC.ExactPrint.Parsers

This module rexposes wrapped parsers from the GHC API. Along with returning the parse result, the corresponding annotations are also returned such that it is then easy to modify the annotations and print the result.

  • 4 types
  • 20 values

Utility

6 declarations
valuewithDynFlags :: LibDir -> (DynFlags -> a) -> IO a
#

Provides a safe way to consume a properly initialised set of DynFlags.

myParser fname expr = withDynFlags (\d -> parseExpr d fname expr)

Module Parsers

4 declarations

Basic Parsers

7 declarations

Internal

7 declarations
valueinitDynFlags :: GhcMonad m => FilePath -> m DynFlags
#

Internal function. Initializes DynFlags value for parsing.

Passes "-hide-all-packages" to the GHC API to prevent parsing of package environment files. However this only works if there is no invocation of setSessionDynFlags before calling initDynFlags. See ghc tickets #15513, #15541.

Requires GhcMonad constraint because there is no pure variant of parseDynamicFilePragma. Yet, in constrast to initDynFlags, it does not (try to) read the file at filepath, but solely depends on the module source in the input string.

Passes "-hide-all-packages" to the GHC API to prevent parsing of package environment files. However this only works if there is no invocation of setSessionDynFlags before calling initDynFlagsPure. See ghc tickets #15513, #15541.