class (Monad m, forall x y. Coercible x y => Coercible (m x) (m y)) => MonadTcPlugin (m :: Type -> Type) whereA MonadTcPlugin is essentially a reader monad over GHC's GHC.Tc.TcM monad.
This means we have both a lift and an unlift operation,
similar to MonadUnliftIO or MonadBaseControl.
See for instance unsafeLiftThroughTcM, which is an example of function that
one would not be able to write using only a lift operation.
Note that you must import the internal module in order to access the methods. Please report a bug if you find yourself needing this functionality.
Methods
liftTcPluginM :: TcPluginM a -> m aLift a computation from GHC's TcPluginM monad.
unsafeLiftTcM :: TcM a -> m aLift a computation from the
GHC.Tc.TcMmonad.unsafeWithRunInTcM :: ((forall a. m a -> TcM a) -> TcM b) -> m bUnlift a computation from the
GHC.Tc.TcMmonad.If this type signature seems confusing, I recommend reading Alexis King's excellent blog post on
MonadBaseControl:
Instances4MonadTcPlugin
MonadTcPlugin (TcPluginM 'Init)Defined in ghc-tcplugin-api-0.20.1.0 · GHC.TcPlugin.API.InternalMonadTcPlugin (TcPluginM 'PostTc)Defined in ghc-tcplugin-api-0.20.1.0 · GHC.TcPlugin.API.InternalMonadTcPlugin (TcPluginM 'Rewrite)Defined in ghc-tcplugin-api-0.20.1.0 · GHC.TcPlugin.API.InternalMonadTcPlugin (TcPluginM 'Solve)Defined in ghc-tcplugin-api-0.20.1.0 · GHC.TcPlugin.API.Internal