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

  • Packageghc-9.10.3
  • Exports219
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceMonad.hs

Initialisation

4 declarations

Simple accessors

37 declarations

Arrow scopes

2 declarations

Unique supply

8 declarations

Accessing input/output

5 declarations

Debugging

10 declarations
valuedumpTcRn :: Bool -> DumpFlag -> String -> DumpFormat -> SDoc -> TcRn ()
#

Unconditionally dump some trace output

Certain tests (T3017, Roles3, T12763 etc.) expect part of the output generated by `-ddump-types` to be in PprUser style. However, generally we want all other debugging output to use PprDump style. We PprUser style if useUserStyle is True.

Typechecker global environment

14 declarations

Error management

26 declarations
valuesetInGeneratedCode :: TcRn a -> TcRn a
#

Mark the inner computation as being done inside generated code.

See Note [Error contexts in generated code]

Usage environment

3 declarations
valuetcCollectingUsage :: TcM a -> TcM (UsageEnv, a)
#

tcCollectingUsage thing_inside runs thing_inside and returns the usage information which was collected as part of the execution of thing_inside. Careful: tcCollectingUsage thing_inside itself does not report any usage information, it's up to the caller to incorporate the returned usage information into the larger context appropriately.

valuetcScalingUsage :: Mult -> TcM a -> TcM a
#

tcScalingUsage mult thing_inside runs thing_inside and scales all the usage information by mult.

Shared error message stuff: renamer and typechecker

13 declarations
valuemapAndRecoverM :: (a -> TcRn b) -> [a] -> TcRn [b]
#

Drop elements of the input that fail, so the result list can be shorter than the argument list

valuemapAndReportM :: (a -> TcRn b) -> [a] -> TcRn [b]
#

Apply the function to all elements on the input list If all succeed, return the list of results Otherwise fail, propagating all errors

valuefoldAndRecoverM :: (b -> a -> TcRn b) -> b -> [a] -> TcRn b
#

The accumulator is not updated if the action fails

Context management for the type checker

10 declarations
valueaddErrCtxt :: SDoc -> TcM a -> TcM a
#

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

valueaddLandmarkErrCtxt :: SDoc -> 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.

Diagnostic message generation (type checker)

21 declarations

Type constraints

36 declarations

Template Haskell context

8 declarations

Safe Haskell context

3 declarations

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

Stuff for the renamer's local env

2 declarations

Stuff for interface decls

13 declarations
valueinitIfaceLoad :: HscEnv -> IfG a -> IO a
#

initIfaceLoad can be used when there's no chance that the action will call typecheckIface when inside a module loop and hence tcIfaceGlobal.

valueinitIfaceLoadModule :: HscEnv -> Module -> IfG a -> IO a
#

This is used when we are doing to call typecheckModule on an ModIface, if it's part of a loop with some other modules then we need to use their IORef TypeEnv vars when typechecking but crucially not our own.

valueforkM :: SDoc -> IfL a -> IfL a
#

Run thing_inside in an interleaved thread. It shares everything with the parent thread, so this is DANGEROUS.

It throws an error if the computation fails

It's used for lazily type-checking interface signatures, which is pretty benign.

See Note [Masking exceptions in forkM]

Stuff for cost centres.

2 declarations

Zonking

2 declarations

Types etc.

0 declarations

Orphan instances

1 instance