ghc-8.0.0.20160204: The GHC API

Safe HaskellNone
LanguageHaskell2010

TcSMonad

Synopsis

Documentation

data WorkList

Constructors

WL 

Instances

data TcS a

Instances

Monad TcS 

Methods

(>>=) :: TcS a -> (a -> TcS b) -> TcS b Source

(>>) :: TcS a -> TcS b -> TcS b Source

return :: a -> TcS a Source

fail :: String -> TcS a Source

Functor TcS 

Methods

fmap :: (a -> b) -> TcS a -> TcS b Source

(<$) :: a -> TcS b -> TcS a Source

MonadFail TcS 

Methods

fail :: String -> TcS a Source

Applicative TcS 

Methods

pure :: a -> TcS a Source

(<*>) :: TcS (a -> b) -> TcS a -> TcS b Source

(*>) :: TcS a -> TcS b -> TcS b Source

(<*) :: TcS a -> TcS b -> TcS a Source

MonadUnique TcS 
HasDynFlags TcS 

runTcS :: TcS a -> TcM (a, EvBindMap)

runTcSDeriveds :: TcS a -> TcM a

This variant of runTcS will keep solving, even when only Deriveds are left around. It also doesn't return any evidence, as callers won't need it.

runTcSWithEvBinds

Arguments

:: Bool

keep running even if only Deriveds are left?

-> Maybe EvBindsVar 
-> TcS a 
-> TcM a 

failTcS :: SDoc -> TcS a

warnTcS :: SDoc -> TcS ()

runTcSEqualities :: TcS a -> TcM a

This can deal only with equality constraints.

nestTcS :: TcS a -> TcS a

panicTcS :: SDoc -> TcS a

traceTcS :: String -> SDoc -> TcS ()

wrapErrTcS :: TcM a -> TcS a

wrapWarnTcS :: TcM a -> TcS a

newWantedEq :: CtLoc -> Role -> TcType -> TcType -> TcS (CtEvidence, Coercion)

Make a new equality CtEvidence

newBoundEvVarId :: TcPredType -> EvTerm -> TcS EvVar

Make a new Id of the given type, bound (in the monad's EvBinds) to the given term

setWantedEq :: TcEvDest -> Coercion -> TcS ()

Equalities only

setEqIfWanted :: CtEvidence -> Coercion -> TcS ()

Equalities only

setWantedEvTerm :: TcEvDest -> EvTerm -> TcS ()

Good for equalities and non-equalities

checkReductionDepth

Arguments

:: CtLoc 
-> TcType

type being reduced

-> TcS () 

Checks if the depth of the given location is too much. Fails if it's too big, with an appropriate error message.

data InertSet

Constructors

IS 

Instances

data InertCans

Constructors

IC 

Fields

updInertDicts :: (DictMap Ct -> DictMap Ct) -> TcS ()

updInertIrreds :: (Cts -> Cts) -> TcS ()

matchableGivens :: CtLoc -> PredType -> InertSet -> Cts

Returns Given constraints that might, potentially, match the given pred. This is used when checking to see if a Given might overlap with an instance. See Note [Instance and Given overlap] in TcInteract.

removeInertCts :: [Ct] -> InertCans -> InertCans

Remove inert constraints from the InertCans, for use when a typechecker plugin wishes to discard a given.

addInertCan :: Ct -> TcS ()

addInertEq :: Ct -> TcS ()

insertFunEq :: FunEqMap a -> TyCon -> [Type] -> a -> FunEqMap a

updInertSafehask :: (DictMap Ct -> DictMap Ct) -> TcS ()

lookupInertDict :: InertCans -> Class -> [Type] -> Maybe CtEvidence

Look up a dictionary inert. NB: the returned CtEvidence might not match the input exactly. Note [Use loose types in inert set].

findDictsByClass :: DictMap a -> Class -> Bag a

addDict :: DictMap a -> Class -> [Type] -> a -> DictMap a

addDictsByClass :: DictMap Ct -> Class -> Bag Ct -> DictMap Ct

delDict :: DictMap a -> Class -> [Type] -> DictMap a

partitionDicts :: (Ct -> Bool) -> DictMap Ct -> (Bag Ct, DictMap Ct)

foldDicts :: (a -> b -> b) -> DictMap a -> b -> b

filterDicts :: (Ct -> Bool) -> DictMap Ct -> DictMap Ct

type EqualCtList = [Ct]

foldTyEqs :: (Ct -> b -> b) -> TyVarEnv EqualCtList -> b -> b

lookupSolvedDict :: InertSet -> Class -> [Type] -> Maybe CtEvidence

Look up a solved inert. NB: the returned CtEvidence might not match the input exactly. See Note [Use loose types in inert set].

foldIrreds :: (Ct -> b -> b) -> Cts -> b -> b

updInertFunEqs :: (FunEqMap Ct -> FunEqMap Ct) -> TcS ()

findFunEq :: FunEqMap a -> TyCon -> [Type] -> Maybe a

sizeFunEqMap :: FunEqMap a -> Int

filterFunEqs :: (Ct -> Bool) -> FunEqMap Ct -> FunEqMap Ct

findFunEqsByTyCon :: FunEqMap a -> TyCon -> [a]

partitionFunEqs :: (Ct -> Bool) -> FunEqMap Ct -> ([Ct], FunEqMap Ct)

foldFunEqs :: (a -> b -> b) -> FunEqMap a -> b -> b

newTcRef :: a -> TcS (TcRef a)

readTcRef :: TcRef a -> TcS a

updTcRef :: TcRef a -> (a -> a) -> TcS ()