Predicate

ghc-8.10.4: The GHC API

Safe Haskell | None
Language | Haskell2010

Predicate

Synopsis

- data Pred
  - = ClassPred Class [Type]
  - | EqPred EqRel Type Type
  - | IrredPred PredType
  - | ForAllPred [TyCoVarBinder] [PredType] PredType
- classifyPredType :: PredType -> Pred
- isPredTy :: HasDebugCallStack => Type -> Bool
- isEvVarType :: Type -> Bool
- data EqRel
  - = NomEq
  - | ReprEq
- eqRelRole :: EqRel -> Role
- isEqPrimPred :: PredType -> Bool
- isEqPred :: PredType -> Bool
- getEqPredTys :: PredType -> (Type, Type)
- getEqPredTys_maybe :: PredType -> Maybe (Role, Type, Type)
- getEqPredRole :: PredType -> Role
- predTypeEqRel :: PredType -> EqRel
- mkPrimEqPred :: Type -> Type -> Type
- mkReprPrimEqPred :: Type -> Type -> Type
- mkPrimEqPredRole :: Role -> Type -> Type -> PredType
- mkHeteroPrimEqPred :: Kind -> Kind -> Type -> Type -> Type
- mkHeteroReprPrimEqPred :: Kind -> Kind -> Type -> Type -> Type
- mkClassPred :: Class -> [Type] -> PredType
- isDictTy :: Type -> Bool
- isClassPred :: PredType -> Bool
- isEqPredClass :: Class -> Bool
- isCTupleClass :: Class -> Bool
- getClassPredTys :: HasDebugCallStack => PredType -> (Class, [Type])
- getClassPredTys_maybe :: PredType -> Maybe (Class, [Type])
- isIPPred :: PredType -> Bool
- isIPPred_maybe :: Type -> Maybe (FastString, Type)
- isIPTyCon :: TyCon -> Bool
- isIPClass :: Class -> Bool
- hasIPPred :: PredType -> Bool
- type DictId = EvId
- isEvVar :: Var -> Bool
- isDictId :: Id -> Bool

# Documentation

data Pred #

A predicate in the solver. The solver tries to prove Wanted predicates from Given ones.

Constructors

ClassPred Class [Type] |
EqPred EqRel Type Type |
IrredPred PredType |
ForAllPred [TyCoVarBinder] [PredType] PredType |

classifyPredType :: PredType -> Pred #

isPredTy :: HasDebugCallStack => Type -> Bool #

isEvVarType :: Type -> Bool #

data EqRel #

A choice of equality relation. This is separate from the type `Role` because `Phantom` does not define a (non-trivial) equality relation.

Constructors

NomEq |
ReprEq |

#### Instances

Instances details

Eq EqRel # |
Instance details Defined in Predicate Methods (==) :: EqRel -> EqRel -> Bool # (/=) :: EqRel -> EqRel -> Bool #
Ord EqRel # |
Instance details Defined in Predicate Methods compare :: EqRel -> EqRel -> Ordering # (<) :: EqRel -> EqRel -> Bool # (<=) :: EqRel -> EqRel -> Bool # (>) :: EqRel -> EqRel -> Bool # (>=) :: EqRel -> EqRel -> Bool # max :: EqRel -> EqRel -> EqRel # min :: EqRel -> EqRel -> EqRel #
Outputable EqRel # |
Instance details Defined in Predicate Methods ppr :: EqRel -> SDoc # pprPrec :: Rational -> EqRel -> SDoc #

eqRelRole :: EqRel -> Role #

isEqPrimPred :: PredType -> Bool #

isEqPred :: PredType -> Bool #

getEqPredTys :: PredType -> (Type, Type) #

getEqPredTys_maybe :: PredType -> Maybe (Role, Type, Type) #

getEqPredRole :: PredType -> Role #

predTypeEqRel :: PredType -> EqRel #

Get the equality relation relevant for a pred type.

mkPrimEqPred :: Type -> Type -> Type #

Creates a primitive type equality predicate. Invariant: the types are not Coercions

mkReprPrimEqPred :: Type -> Type -> Type #

mkPrimEqPredRole :: Role -> Type -> Type -> PredType #

Makes a lifted equality predicate at the given role

mkHeteroPrimEqPred :: Kind -> Kind -> Type -> Type -> Type #

Creates a primite type equality predicate with explicit kinds

mkHeteroReprPrimEqPred :: Kind -> Kind -> Type -> Type -> Type #

Creates a primitive representational type equality predicate with explicit kinds

mkClassPred :: Class -> [Type] -> PredType #

isDictTy :: Type -> Bool #

isClassPred :: PredType -> Bool #

isEqPredClass :: Class -> Bool #

isCTupleClass :: Class -> Bool #

getClassPredTys :: HasDebugCallStack => PredType -> (Class, [Type]) #

getClassPredTys_maybe :: PredType -> Maybe (Class, [Type]) #

isIPPred :: PredType -> Bool #

isIPPred_maybe :: Type -> Maybe (FastString, Type) #

isIPTyCon :: TyCon -> Bool #

isIPClass :: Class -> Bool #

hasIPPred :: PredType -> Bool #

type DictId = EvId #

Dictionary Identifier

isEvVar :: Var -> Bool #

isDictId :: Id -> Bool #