1 {-# GHC_PRAGMA INTERFACE VERSION 5 #-}
3 import Class(Class, ClassOp)
5 import HsExpr(ArithSeqInfo, Expr, Qual, RenamedArithSeqInfo(..), RenamedExpr(..))
7 import HsMatches(Match)
8 import HsPat(InPat, RenamedPat(..))
9 import HsTypes(PolyType)
11 import IdInfo(SpecEnv)
12 import InstEnv(ClassInstEnv(..), InstTemplate, InstanceMapper(..), MatchEnv(..))
15 import NameTypes(FullName, ShortName)
16 import Outputable(Outputable)
17 import PreludePS(_PackedString)
18 import PreludeRatio(Ratio(..))
19 import Pretty(PprStyle, PrettyRep)
20 import PrimKind(PrimKind)
24 import TyVar(TyVar, TyVarTemplate)
25 import UniType(UniType)
31 data Inst = Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin
32 data InstOrigin = OccurrenceOf Id SrcLoc | InstanceDeclOrigin SrcLoc | LiteralOrigin Literal SrcLoc | ArithSeqOrigin (ArithSeqInfo Name (InPat Name)) SrcLoc | SignatureOrigin | ClassDeclOrigin SrcLoc | DerivingOrigin (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)) Class Bool TyCon SrcLoc | InstanceSpecOrigin (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)) Class UniType SrcLoc | DefaultDeclOrigin SrcLoc | ValSpecOrigin Name SrcLoc | CCallOrigin SrcLoc [Char] (Labda (Expr Name (InPat Name))) | LitLitOrigin SrcLoc [Char] | UnknownOrigin
33 data OverloadedLit = OverloadedIntegral Integer Id Id | OverloadedFractional (Ratio Integer) Id
34 type RenamedArithSeqInfo = ArithSeqInfo Name (InPat Name)
35 type RenamedExpr = Expr Name (InPat Name)
38 type RenamedPat = InPat Name
40 type ClassInstEnv = [(UniType, InstTemplate)]
42 type InstanceMapper = Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)
43 type MatchEnv a b = [(a, b)]
53 applySubstToInst :: Subst -> Inst -> (Subst, Inst)
54 apply_to_Inst :: (UniType -> UniType) -> Inst -> Inst
55 extractConstrainedTyVarsFromInst :: Inst -> [TyVar]
56 extractTyVarsFromInst :: Inst -> [TyVar]
57 getDictClassAndType :: Inst -> (Class, UniType)
58 getInstOrigin :: Inst -> (SrcLoc, PprStyle -> Int -> Bool -> PrettyRep)
59 getInstUniType :: Inst -> UniType
60 instBindingRequired :: Inst -> Bool
61 instCanBeGeneralised :: Inst -> Bool
62 isTyVarDict :: Inst -> Bool
63 matchesInst :: Inst -> Inst -> Bool
64 mkDict :: Unique -> Class -> UniType -> InstOrigin -> Inst
65 mkLitInst :: Unique -> OverloadedLit -> UniType -> InstOrigin -> Inst
66 mkMethod :: Unique -> Id -> [UniType] -> InstOrigin -> Inst
67 instance Outputable Inst