hie-bios-0.12.0: Set up a GHC API session

Safe Haskell | Safe-Inferred
Language | Haskell2010

HIE.Bios.Ghc.Gap

Contents

- Warnings, Doc Compat
- Argument parsing
- Ghc Monad
- Hsc Monad
- Driver compat
- HscEnv Compat
- AST compat
- Exceptions
- Doc Gap functions
- DynFlags compat
- Platform constants
- misc

Description

All the CPP for GHC version compability should live in this module.

Synopsis

- ghcVersion :: String
- type WarnFlags = EnumSet WarningFlag
- emptyWarnFlags :: WarnFlags
- makeUserStyle :: DynFlags -> NamePprCtx -> PprStyle
- data PprStyle
- parseTargetFiles :: DynFlags -> [String] -> (DynFlags, [(String, Maybe Phase)], [String])
- modifySession :: GhcMonad m => (HscEnv -> HscEnv) -> m ()
- reflectGhc :: Ghc a -> Session -> IO a
- data Session = Session !(IORef HscEnv)
- getHscEnv :: Hsc HscEnv
- batchMsg :: Messager
- set_hsc_dflags :: DynFlags -> HscEnv -> HscEnv
- overPkgDbRef :: (FilePath -> FilePath) -> PackageDBFlag -> PackageDBFlag
- guessTarget :: GhcMonad m => String -> Maybe UnitId -> Maybe Phase -> m Target
- setNoCode :: DynFlags -> DynFlags
- getModSummaries :: ModuleGraph -> [ModSummary]
- mapOverIncludePaths :: (FilePath -> FilePath) -> DynFlags -> DynFlags
- getLogger :: HscEnv -> Logger
- pattern RealSrcSpan :: RealSrcSpan -> SrcSpan
- type LExpression = LHsExpr GhcTc
- type LBinding = LHsBind GhcTc
- type LPattern = LPat GhcTc
- inTypes :: MatchGroup GhcTc LExpression -> [Type]
- outType :: MatchGroup GhcTc LExpression -> Type
- catch :: (MonadCatch m, Exception e) => m a -> (e -> m a) -> m a
- bracket :: MonadMask m => m a -> (a -> m c) -> (a -> m b) -> m b
- handle :: (MonadCatch m, Exception e) => (e -> m a) -> m a -> m a
- pageMode :: Mode
- oneLineMode :: Mode
- initializePluginsForModSummary :: HscEnv -> ModSummary -> IO (Int, [ModuleName], ModSummary)
- setFrontEndHooks :: Maybe (ModSummary -> Hsc FrontendResult) -> HscEnv -> HscEnv
- updOptLevel :: Int -> DynFlags -> DynFlags
- setWayDynamicIfHostIsDynamic :: DynFlags -> DynFlags
- gopt_set :: DynFlags -> GeneralFlag -> DynFlags
- parseDynamicFlags :: MonadIO m => Logger -> DynFlags -> [Located String] -> m (DynFlags, [Located String], [Warn])
- hostIsDynamic :: Bool
- getModuleName :: (a, b) -> a
- getTyThing :: (a, b, c, d, e) -> a
- fixInfo :: (a, b, c, d, e) -> (a, b, c, d)
- data FrontendResult = FrontendTypecheck TcGblEnv
- data Hsc a
- mapMG :: (ModSummary -> ModSummary) -> ModuleGraph -> ModuleGraph
- mgModSummaries :: ModuleGraph -> [ModSummary]
- unsetLogAction :: GhcMonad m => m ()
- load' :: GhcMonad m => Maybe ModIfaceCache -> LoadHowMuch -> Maybe Messager -> ModuleGraph -> m SuccessFlag
- homeUnitId_ :: DynFlags -> UnitId
- getDynFlags :: HasDynFlags m => m DynFlags

# Documentation

ghcVersion :: String #

# Warnings, Doc Compat

type WarnFlags = EnumSet WarningFlag #

emptyWarnFlags :: WarnFlags #

makeUserStyle :: DynFlags -> NamePprCtx -> PprStyle #

data PprStyle #

#### Instances

Instances details

Outputable PprStyle |
Instance details Defined in GHC.Utils.Outputable Methods ppr :: PprStyle -> SDoc

# Argument parsing

parseTargetFiles :: DynFlags -> [String] -> (DynFlags, [(String, Maybe Phase)], [String]) #

# Ghc Monad

modifySession :: GhcMonad m => (HscEnv -> HscEnv) -> m () #

reflectGhc :: Ghc a -> Session -> IO a #

data Session #

Constructors

Session !(IORef HscEnv) |

# Hsc Monad

getHscEnv :: Hsc HscEnv #

# Driver compat

batchMsg :: Messager #

# HscEnv Compat

set_hsc_dflags :: DynFlags -> HscEnv -> HscEnv #

overPkgDbRef :: (FilePath -> FilePath) -> PackageDBFlag -> PackageDBFlag #

guessTarget :: GhcMonad m => String -> Maybe UnitId -> Maybe Phase -> m Target #

setNoCode :: DynFlags -> DynFlags #

getModSummaries :: ModuleGraph -> [ModSummary] #

mapOverIncludePaths :: (FilePath -> FilePath) -> DynFlags -> DynFlags #

getLogger :: HscEnv -> Logger #

# AST compat

pattern RealSrcSpan :: RealSrcSpan -> SrcSpan #

type LExpression = LHsExpr GhcTc #

type LBinding = LHsBind GhcTc #

type LPattern = LPat GhcTc #

inTypes :: MatchGroup GhcTc LExpression -> [Type] #

outType :: MatchGroup GhcTc LExpression -> Type #

# Exceptions

catch :: (MonadCatch m, Exception e) => m a -> (e -> m a) -> m a #

bracket :: MonadMask m => m a -> (a -> m c) -> (a -> m b) -> m b #

handle :: (MonadCatch m, Exception e) => (e -> m a) -> m a -> m a #

# Doc Gap functions

pageMode :: Mode #

oneLineMode :: Mode #

# DynFlags compat

initializePluginsForModSummary :: HscEnv -> ModSummary -> IO (Int, [ModuleName], ModSummary) #

setFrontEndHooks :: Maybe (ModSummary -> Hsc FrontendResult) -> HscEnv -> HscEnv #

updOptLevel :: Int -> DynFlags -> DynFlags #

setWayDynamicIfHostIsDynamic :: DynFlags -> DynFlags #

gopt_set :: DynFlags -> GeneralFlag -> DynFlags #

parseDynamicFlags :: MonadIO m => Logger -> DynFlags -> [Located String] -> m (DynFlags, [Located String], [Warn]) #

# Platform constants

hostIsDynamic :: Bool #

# misc

getModuleName :: (a, b) -> a #

getTyThing :: (a, b, c, d, e) -> a #

fixInfo :: (a, b, c, d, e) -> (a, b, c, d) #

data FrontendResult #

Constructors

FrontendTypecheck TcGblEnv |

data Hsc a #

#### Instances

Instances details

MonadIO Hsc |
Instance details Defined in GHC.Driver.Env.Types Methods liftIO :: IO a -> Hsc a #
Applicative Hsc |
Instance details Defined in GHC.Driver.Env.Types Methods pure :: a -> Hsc a # (<*>) :: Hsc (a -> b) -> Hsc a -> Hsc b liftA2 :: (a -> b -> c) -> Hsc a -> Hsc b -> Hsc c (*>) :: Hsc a -> Hsc b -> Hsc b (<*) :: Hsc a -> Hsc b -> Hsc a
Functor Hsc |
Instance details Defined in GHC.Driver.Env.Types Methods fmap :: (a -> b) -> Hsc a -> Hsc b # (<$) :: a -> Hsc b -> Hsc a #
Monad Hsc |
Instance details Defined in GHC.Driver.Env.Types Methods (>>=) :: Hsc a -> (a -> Hsc b) -> Hsc b (>>) :: Hsc a -> Hsc b -> Hsc b return :: a -> Hsc a #
HasDynFlags Hsc |
Instance details Defined in GHC.Driver.Env.Types Methods getDynFlags :: Hsc DynFlags #
HasLogger Hsc |
Instance details Defined in GHC.Driver.Env.Types Methods getLogger :: Hsc Logger

mapMG :: (ModSummary -> ModSummary) -> ModuleGraph -> ModuleGraph #

mgModSummaries :: ModuleGraph -> [ModSummary] #

unsetLogAction :: GhcMonad m => m () #

load' :: GhcMonad m => Maybe ModIfaceCache -> LoadHowMuch -> Maybe Messager -> ModuleGraph -> m SuccessFlag #

homeUnitId_ :: DynFlags -> UnitId #

getDynFlags :: HasDynFlags m => m DynFlags #