module GHC.Corroborate.Constraint (newGiven) where

import GhcApi.Constraint (CtEvidence)
import Panic (panicDoc)
import qualified TcPluginM (newGiven)
import GHC.Corroborate

-- | Create a new [G]iven constraint, with the supplied evidence. This must not
-- be invoked from 'tcPluginInit' or 'tcPluginStop', or it will panic.
newGiven :: CtLoc -> PredType -> EvTerm -> TcPluginM CtEvidence
newGiven :: CtLoc -> PredType -> EvTerm -> TcPluginM CtEvidence
newGiven CtLoc
loc PredType
pty (EvExpr EvExpr
ev) = CtLoc -> PredType -> EvExpr -> TcPluginM CtEvidence
TcPluginM.newGiven CtLoc
loc PredType
pty EvExpr
ev
newGiven CtLoc
_ PredType
_  EvTerm
ev = String -> SDoc -> TcPluginM CtEvidence
forall a. String -> SDoc -> a
panicDoc String
"newGiven: not an EvExpr: " (EvTerm -> SDoc
forall a. Outputable a => a -> SDoc
ppr EvTerm
ev)