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) [Tbind] Axiom (Maybe Ty)
16 = Constr (Qual Dcon) [Tbind] [Ty]
17 | GadtConstr (Qual Dcon) Ty
20 type Axiom = (Qual Tcon, [Tbind], Kind)
26 -- Top-level bindings are qualified, so that the printer doesn't have to pass
27 -- around the module name.
28 type Vdef = (Bool,Qual Var,Ty,Exp)
38 | Case Exp Vbind Ty [Alt] {- non-empty list -}
41 | External String String Ty {- target name, convention, and type -}
42 | DynExternal String Ty {- convention and type (incl. Addr# of target as first arg) -}
50 = Acon (Qual Dcon) [Tbind] [Vbind] Exp
55 type Tbind = (Tvar,Kind)
73 | Lrational Rational Ty
84 type Qual t = (Mname,t)
89 -- For truly horrible reasons, this must be z-encoded.
90 -- With any hope, the z-encoding will die soon.
91 primMname = "ghczmprim:GHCziPrim"
94 tcArrow = (primMname, "(->)")