ghc-8.0.0.20160111: The GHC API

Safe HaskellNone
LanguageHaskell2010

TcRnMonad

Contents

Synopsis

Documentation

initTc :: HscEnv -> HscSource -> Bool -> Module -> RealSrcSpan -> TcM r -> IO (Messages, Maybe r)

Setup the initial typechecking environment

initTcRnIf :: Char -> HscEnv -> gbl -> lcl -> TcRnIf gbl lcl a -> IO a

discardResult :: TcM a -> TcM ()

getGblEnv :: TcRnIf gbl lcl gbl

updGblEnv :: (gbl -> gbl) -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a

setGblEnv :: gbl -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a

getLclEnv :: TcRnIf gbl lcl lcl

updLclEnv :: (lcl -> lcl) -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a

setLclEnv :: lcl' -> TcRnIf gbl lcl' a -> TcRnIf gbl lcl a

getEnvs :: TcRnIf gbl lcl (gbl, lcl)

setEnvs :: (gbl', lcl') -> TcRnIf gbl' lcl' a -> TcRnIf gbl lcl a

xoptM :: Extension -> TcRnIf gbl lcl Bool

doptM :: DumpFlag -> TcRnIf gbl lcl Bool

setXOptM :: Extension -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a

unsetGOptM :: GeneralFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a

unsetWOptM :: WarningFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a

whenDOptM :: DumpFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()

Do it flag is true

whenGOptM :: GeneralFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()

whenWOptM :: WarningFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()

whenXOptM :: Extension -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()

withDoDynamicToo :: TcRnIf gbl lcl a -> TcRnIf gbl lcl a

updateEps :: (ExternalPackageState -> (ExternalPackageState, a)) -> TcRnIf gbl lcl a

Update the external package state. Returns the second result of the modifier function.

This is an atomic operation and forces evaluation of the modified EPS in order to avoid space leaks.

updateEps_ :: (ExternalPackageState -> ExternalPackageState) -> TcRnIf gbl lcl ()

Update the external package state.

This is an atomic operation and forces evaluation of the modified EPS in order to avoid space leaks.

newTcRef :: a -> TcRnIf gbl lcl (TcRef a)

readTcRef :: TcRef a -> TcRnIf gbl lcl a

writeTcRef :: TcRef a -> a -> TcRnIf gbl lcl ()

updTcRef :: TcRef a -> (a -> a) -> TcRnIf gbl lcl ()

updTcRefX :: TcRef a -> (a -> a) -> TcRnIf gbl lcl a

traceTc :: String -> SDoc -> TcRn ()

traceTcN :: Int -> SDoc -> TcRn ()

Typechecker trace

traceRn :: SDoc -> TcRn ()

traceOptTcRn :: DumpFlag -> SDoc -> TcRn ()

Output a doc if the given DumpFlag is set.

By default this logs to stdout However, if the `-ddump-to-file` flag is set, then this will dump output to a file

Just a wrapper for dumpSDoc

traceTcRn :: DumpFlag -> SDoc -> TcRn ()

Unconditionally dump some trace output

The DumpFlag is used only to set the output filename for --dump-to-file, not to decide whether or not to output That part is done by the caller

printForUserTcRn :: SDoc -> TcRn ()

Like logInfoTcRn, but for user consumption

debugDumpTcRn :: SDoc -> TcRn ()

Typechecker debug

traceIf :: SDoc -> TcRnIf m n ()

traceHiDiffs :: SDoc -> TcRnIf m n ()

traceOptIf :: DumpFlag -> SDoc -> TcRnIf m n ()

setModule :: Module -> TcRn a -> TcRn a

extendFixityEnv :: [(Name, FixItem)] -> RnM a -> RnM a

addLocM :: (a -> TcM b) -> Located a -> TcM b

wrapLocM :: (a -> TcM b) -> Located a -> TcM (Located b)

wrapLocFstM :: (a -> TcM (b, c)) -> Located a -> TcM (Located b, c)

wrapLocSndM :: (a -> TcM (b, c)) -> Located a -> TcM (b, Located c)

addErr :: MsgDoc -> TcRn ()

addErrs :: [(SrcSpan, MsgDoc)] -> TcRn ()

checkErr :: Bool -> MsgDoc -> TcRn ()

warnIf :: Bool -> MsgDoc -> TcRn ()

recoverM :: TcRn r -> TcRn r -> TcRn r

mapAndRecoverM :: (a -> TcRn b) -> [a] -> TcRn [b]

mapAndReportM :: (a -> TcRn b) -> [a] -> TcRn [b]

Succeeds if applying the argument to all members of the lists succeeds, but nevertheless runs it on all arguments, to collect all errors.

askNoErrs :: TcRn a -> TcRn (a, Bool)

tryTcLIE_ :: TcM r -> TcM r -> TcM r

checkNoErrs :: TcM r -> TcM r

whenNoErrs :: TcM () -> TcM ()

ifErrsM :: TcRn r -> TcRn r -> TcRn r

checkTH :: a -> String -> TcRn ()

failTH :: Outputable a => a -> String -> TcRn x

setErrCtxt :: [ErrCtxt] -> TcM a -> TcM a

addErrCtxt :: MsgDoc -> TcM a -> TcM a

Add a fixed message to the error context. This message should not do any tidying.

addErrCtxtM :: (TidyEnv -> TcM (TidyEnv, MsgDoc)) -> TcM a -> TcM a

Add a message to the error context. This message may do tidying.

addLandmarkErrCtxt :: MsgDoc -> TcM a -> TcM a

Add a fixed landmark message to the error context. A landmark message is always sure to be reported, even if there is a lot of context. It also doesn't count toward the maximum number of contexts reported.

addLandmarkErrCtxtM :: (TidyEnv -> TcM (TidyEnv, MsgDoc)) -> TcM a -> TcM a

Variant of addLandmarkErrCtxt that allows for monadic operations and tidying.

updCtxt :: ([ErrCtxt] -> [ErrCtxt]) -> TcM a -> TcM a

popErrCtxt :: TcM a -> TcM a

setCtLocM :: CtLoc -> TcM a -> TcM a

addErrsTc :: [MsgDoc] -> TcM ()

checkTc :: Bool -> MsgDoc -> TcM ()

checkTcM :: Bool -> (TidyEnv, MsgDoc) -> TcM ()

failIfTc :: Bool -> MsgDoc -> TcM ()

warnTc :: Bool -> MsgDoc -> TcM ()

warnTcM :: Bool -> (TidyEnv, MsgDoc) -> TcM ()

tcInitOpenTidyEnv :: TyCoVarSet -> TcM TidyEnv

Get a TidyEnv that includes mappings for all vars free in the given type. Useful when tidying open types.

debugTc :: TcM () -> TcM ()

emitSimple :: Ct -> TcM ()

discardConstraints :: TcM a -> TcM a

Throw out any constraints emitted by the thing_inside

setTcLevel :: TcLevel -> TcM a -> TcM a

setStage :: ThStage -> TcM a -> TcRn a

recordUnsafeInfer :: WarningMessages -> TcM ()

Mark that safe inference has failed See Note [Safe Haskell Overlapping Instances Implementation] although this is used for more than just that failure case.

finalSafeMode :: DynFlags -> TcGblEnv -> IO SafeHaskellMode

Figure out the final correct safe haskell mode

fixSafeInstances :: SafeHaskellMode -> [ClsInst] -> [ClsInst]

Switch instances to safe instances if we're in Safe mode.

initIfaceTcRn :: IfG a -> TcRn a

Run an IfG (top-level interface monad) computation inside an existing TcRn (typecheck-renaming monad) computation by initializing an IfGblEnv based on TcGblEnv.

initIfaceTc :: ModIface -> (TcRef TypeEnv -> IfL a) -> TcRnIf gbl lcl a

initIfaceLcl :: Module -> SDoc -> IfL a -> IfM lcl a

forkM_maybe :: SDoc -> IfL a -> IfL (Maybe a)

forkM :: SDoc -> IfL a -> IfL a

module TcRnTypes

module IOEnv

Orphan instances

MonadUnique (IOEnv (Env gbl lcl)) 

Methods

getUniqueSupplyM :: IOEnv (Env gbl lcl) UniqSupply

getUniqueM :: IOEnv (Env gbl lcl) Unique

getUniquesM :: IOEnv (Env gbl lcl) [Unique]