hie-bios-0.12.1: Set up a GHC API session
Safe HaskellSafe-Inferred
LanguageHaskell2010

HIE.Bios.Ghc.Gap

Description

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

Synopsis

Documentation

Warnings, Doc Compat

data PprStyle #

Instances

Instances details
Outputable PprStyle 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: PprStyle -> SDoc #

Argument parsing

Ghc Monad

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

Set the current session to the result of applying the current session to the argument.

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

Reflect a computation in the Ghc monad into the IO monad.

You can use this to call functions returning an action in the Ghc monad inside an IO action. This is needed for some (too restrictive) callback arguments of some library functions:

libFunc :: String -> (Int -> IO a) -> IO a
ghcFunc :: Int -> Ghc a

ghcFuncUsingLibFunc :: String -> Ghc a -> Ghc a
ghcFuncUsingLibFunc str =
  reifyGhc $ \s ->
    libFunc $ \i -> do
      reflectGhc (ghcFunc i) s

data Session #

The Session is a handle to the complete state of a compilation session. A compilation session consists of a set of modules constituting the current program or library, the context for interactive evaluation, and various caches.

Constructors

Session !(IORef HscEnv) 

Hsc Monad

Driver compat

HscEnv Compat

AST compat

Exceptions

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

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

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

Doc Gap functions

DynFlags compat

updOptLevel :: Int -> DynFlags -> DynFlags #

Sets the DynFlags to be appropriate to the optimisation level

Platform constants

misc

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

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

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

data FrontendResult #

FrontendResult describes the result of running the frontend of a Haskell module. Currently one always gets a FrontendTypecheck, since running the frontend involves typechecking a program. hs-sig merges are not handled here.

This data type really should be in GHC.Driver.Env, but it needs to have a TcGblEnv which is only defined here.

data Hsc a #

The Hsc monad: Passing an environment and warning state

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

HasLogger Hsc 
Instance details

Defined in GHC.Driver.Env.Types

Methods

getLogger :: Hsc Logger #

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

Map a function f over all the ModSummaries. To preserve invariants f can't change the isBoot status.

homeUnitId_ :: DynFlags -> UnitId #

Target home unit-id