-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Utilities for writing GHC type-checker plugins
--   
--   Utilities for writing GHC type-checker plugins, such as creating
--   constraints, with a stable API covering multiple GHC releases.
@package ghc-tcplugins-extra
@version 0.4.6

module GHC.TcPluginM.Extra

-- | Create a new Wanted constraint with the given CtLoc.
newWanted :: CtLoc -> PredType -> TcPluginM CtEvidence

-- | Create a new [G]iven constraint, with the supplied evidence. This must
--   not be invoked from tcPluginInit or tcPluginStop, or
--   it will panic.
newGiven :: EvBindsVar -> CtLoc -> PredType -> EvTerm -> TcPluginM CtEvidence

-- | The EvTerm equivalent for unsafeCoerce
evByFiat :: String -> Type -> Type -> EvTerm

-- | Find a module
lookupModule :: ModuleName -> FastString -> TcPluginM Module

-- | Find a Name in a Module given an OccName
lookupName :: Module -> OccName -> TcPluginM Name

-- | Print out extra information about the initialisation, stop, and every
--   run of the plugin when -ddump-tc-trace is enabled.
tracePlugin :: String -> TcPlugin -> TcPlugin

-- | Flattens evidence of constraints by substituting each others
--   equalities.
--   
--   NB: Should only be used on [G]iven constraints!
--   
--   NB: Doesn't flatten under binders
flattenGivens :: [Ct] -> [Ct]

-- | Create simple substitution from type equalities
mkSubst :: Ct -> Maybe ((TcTyVar, TcType), Ct)

-- | Create flattened substitutions from type equalities, i.e. the
--   substitutions have been applied to each others right hand sides.
mkSubst' :: [Ct] -> [((TcTyVar, TcType), Ct)]

-- | Apply substitutions in Types
--   
--   NB: Doesn't substitute under binders
substType :: [(TcTyVar, TcType)] -> TcType -> TcType

-- | Apply substitution in the evidence of Cts
substCt :: [(TcTyVar, TcType)] -> Ct -> Ct
