[project @ 1996-01-11 14:06:51 by partain]
[ghc-hetmet.git] / ghc / compiler / basicTypes / Inst.hi
1 {-# GHC_PRAGMA INTERFACE VERSION 5 #-}
2 interface Inst where
3 import Class(Class, ClassOp)
4 import HsBinds(Binds)
5 import HsExpr(ArithSeqInfo, Expr, Qual, RenamedArithSeqInfo(..), RenamedExpr(..))
6 import HsLit(Literal)
7 import HsMatches(Match)
8 import HsPat(InPat, RenamedPat(..))
9 import HsTypes(PolyType)
10 import Id(Id)
11 import IdInfo(SpecEnv)
12 import InstEnv(ClassInstEnv(..), InstTemplate, InstanceMapper(..), MatchEnv(..))
13 import Maybes(Labda)
14 import Name(Name)
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)
21 import SrcLoc(SrcLoc)
22 import Subst(Subst)
23 import TyCon(TyCon)
24 import TyVar(TyVar, TyVarTemplate)
25 import UniType(UniType)
26 import Unique(Unique)
27 data Class 
28 data ClassOp 
29 data ArithSeqInfo a b 
30 data Expr a b 
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)
36 data Literal 
37 data InPat a 
38 type RenamedPat = InPat Name
39 data Id 
40 type ClassInstEnv = [(UniType, InstTemplate)]
41 data InstTemplate 
42 type InstanceMapper = Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)
43 type MatchEnv a b = [(a, b)]
44 data Name 
45 data PrimKind 
46 data SrcLoc 
47 data Subst 
48 data TyCon 
49 data TyVar 
50 data TyVarTemplate 
51 data UniType 
52 data Unique 
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
68