2 % (c) The University of Glasgow 2001-2006
5 module ExternalCore where
9 = Module Mname [Tdef] [Vdefg]
12 = Data (Qual Tcon) [Tbind] [Cdef]
13 | Newtype (Qual Tcon) (Qual Tcon) [Tbind] Ty
16 = Constr (Qual Dcon) [Tbind] [Ty]
17 | GadtConstr (Qual Dcon) Ty
23 -- Top-level bindings are qualified, so that the printer doesn't have to pass
24 -- around the module name.
25 type Vdef = (Bool,Qual Var,Ty,Exp)
35 | Case Exp Vbind Ty [Alt] {- non-empty list -}
38 | External String String Ty {- target name, convention, and type -}
39 | DynExternal String Ty {- convention and type (incl. Addr# of target as first arg) -}
47 = Acon (Qual Dcon) [Tbind] [Vbind] Exp
52 type Tbind = (Tvar,Kind)
59 -- We distinguish primitive coercions
60 -- (represented in GHC by wired-in names), because
61 -- External Core treats them specially, so we have
62 -- to print them out with special syntax.
65 | UnsafeCoercion Ty Ty
80 | Lrational Rational Ty
91 type Qual t = (Mname,t)
96 -- For truly horrible reasons, this must be z-encoded.
97 -- With any hope, the z-encoding will die soon.
98 primMname = "ghczmprim:GHCziPrim"
101 tcArrow = (primMname, "(->)")