GHC.Tc.Errors.Hole

ghc-9.2.0.20210422: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Tc.Errors.Hole

Synopsis

- findValidHoleFits :: TidyEnv -> [Implication] -> [Ct] -> Hole -> TcM (TidyEnv, SDoc)
- data HoleFitPlugin = HoleFitPlugin {
  - candPlugin :: CandPlugin
  - fitPlugin :: FitPlugin
  }
- data HoleFitPluginR = forall s.HoleFitPluginR {
  - hfPluginInit :: TcM (TcRef s)
  - hfPluginRun :: TcRef s -> HoleFitPlugin
  - hfPluginStop :: TcRef s -> TcM ()
  }

# Documentation

findValidHoleFits Source #

Arguments

:: TidyEnv | The tidy_env for zonking
-> [Implication] | Enclosing implications for givens
-> [Ct] | The unsolved simple constraints in the implication for the hole.
-> Hole |
-> TcM (TidyEnv, SDoc) |

data HoleFitPlugin Source #

A HoleFitPlugin is a pair of candidate and fit plugins.

Constructors

HoleFitPlugin |
Fields candPlugin :: CandPlugin fitPlugin :: FitPlugin

data HoleFitPluginR Source #

HoleFitPluginR adds a TcRef to hole fit plugins so that plugins can track internal state. Note the existential quantification, ensuring that the state cannot be modified from outside the plugin.

Constructors

forall s. HoleFitPluginR |
Fields hfPluginInit :: TcM (TcRef s) Initializes the TcRef to be passed to the plugin hfPluginRun :: TcRef s -> HoleFitPlugin The function defining the plugin itself hfPluginStop :: TcRef s -> TcM () Cleanup of state, guaranteed to be called even on error