ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Tc.Zonk.Monad

Contents

- The `ZonkM` monad, a stripped down `TcM` for zonking
  - Logging within `ZonkM`

Description

The `ZonkM` monad, a stripped down `TcM`, used when zonking within the typechecker in GHC.Tc.Zonk.TcType.

See Note [Module structure for zonking] in GHC.Tc.Zonk.Type.

Synopsis

- data ZonkM a where
  - pattern ZonkM :: (ZonkGblEnv -> IO a) -> ZonkM a
- data ZonkGblEnv = ZonkGblEnv {
  - zge_logger :: Logger
  - zge_name_ppr_ctx :: NamePprCtx
  - zge_src_span :: SrcSpan
  - zge_tc_level :: TcLevel
  - zge_binder_stack :: TcBinderStack
  }
- getZonkGblEnv :: ZonkM ZonkGblEnv
- getZonkTcLevel :: ZonkM TcLevel
- traceZonk :: String -> SDoc -> ZonkM ()

# The `ZonkM` monad, a stripped down `TcM` for zonking

data ZonkM a where #

A stripped down version of `TcM` which is sufficient for zonking types.

Bundled Patterns

pattern ZonkM :: (ZonkGblEnv -> IO a) -> ZonkM a |

#### Instances

Instances details

MonadIO ZonkM # |
Instance details Defined in GHC.Tc.Zonk.Monad Methods liftIO :: IO a -> ZonkM a #
Applicative ZonkM # |
Instance details Defined in GHC.Tc.Zonk.Monad Methods pure :: a -> ZonkM a # (<*>) :: ZonkM (a -> b) -> ZonkM a -> ZonkM b # liftA2 :: (a -> b -> c) -> ZonkM a -> ZonkM b -> ZonkM c # (*>) :: ZonkM a -> ZonkM b -> ZonkM b # (<*) :: ZonkM a -> ZonkM b -> ZonkM a #
Functor ZonkM # |
Instance details Defined in GHC.Tc.Zonk.Monad Methods fmap :: (a -> b) -> ZonkM a -> ZonkM b # (<$) :: a -> ZonkM b -> ZonkM a #
Monad ZonkM # |
Instance details Defined in GHC.Tc.Zonk.Monad Methods (>>=) :: ZonkM a -> (a -> ZonkM b) -> ZonkM b # (>>) :: ZonkM a -> ZonkM b -> ZonkM b # return :: a -> ZonkM a #

data ZonkGblEnv #

Information needed by the `ZonkM` monad, which is a slimmed down version of `TcM` with just enough information for zonking.

Constructors

ZonkGblEnv |
Fields zge_logger :: Logger zge_name_ppr_ctx :: NamePprCtx zge_src_span :: SrcSpan zge_tc_level :: TcLevel zge_binder_stack :: TcBinderStack

getZonkGblEnv :: ZonkM ZonkGblEnv #

getZonkTcLevel :: ZonkM TcLevel #

## Logging within `ZonkM`

traceZonk :: String -> SDoc -> ZonkM () #

Same as `traceTc`, but for the `ZonkM` monad.