Fix primMname in External Core printer
[ghc-hetmet.git] / compiler / coreSyn / ExternalCore.lhs
1 %
2 % (c) The University of Glasgow 2001-2006
3 %
4 \begin{code}
5 module ExternalCore where
6
7
8 data Module 
9  = Module Mname [Tdef] [Vdefg]
10
11 data Tdef 
12   = Data (Qual Tcon) [Tbind] [Cdef]
13   | Newtype (Qual Tcon) [Tbind] (Maybe Ty)
14
15 data Cdef 
16   = Constr Dcon [Tbind] [Ty]
17   | GadtConstr Dcon Ty
18
19 data Vdefg 
20   = Rec [Vdef]
21   | Nonrec Vdef
22
23 type Vdef = (Bool,Var,Ty,Exp)   -- Top level bindings are unqualified now
24
25 data Exp 
26   = Var (Qual Var)
27   | Dcon (Qual Dcon)
28   | Lit Lit
29   | App Exp Exp
30   | Appt Exp Ty
31   | Lam Bind Exp          
32   | Let Vdefg Exp
33   | Case Exp Vbind Ty [Alt] {- non-empty list -}
34   | Cast Exp Ty
35   | Note String Exp
36   | External String String Ty {- target name, convention, and type -} 
37   | DynExternal String Ty {- convention and type (incl. Addr# of target as first arg) -} 
38   | Label String
39
40 data Bind 
41   = Vb Vbind
42   | Tb Tbind
43
44 data Alt 
45   = Acon (Qual Dcon) [Tbind] [Vbind] Exp
46   | Alit Lit Exp
47   | Adefault Exp
48
49 type Vbind = (Var,Ty)
50 type Tbind = (Tvar,Kind)
51
52 data Ty 
53   = Tvar Tvar
54   | Tcon (Qual Tcon)
55   | Tapp Ty Ty
56   | Tforall Tbind Ty 
57
58 data Kind 
59   = Klifted
60   | Kunlifted
61   | Kunboxed
62   | Kopen
63   | Karrow Kind Kind
64   | Keq Ty Ty
65
66 data Lit 
67   = Lint Integer Ty
68   | Lrational Rational Ty
69   | Lchar Char Ty
70   | Lstring String Ty
71   
72
73 type Mname = Id
74 type Var = Id
75 type Tvar = Id
76 type Tcon = Id
77 type Dcon = Id
78
79 type Qual t = (Mname,t)
80
81 type Id = String
82
83 primMname :: Mname
84 -- For truly horrible reasons, this must be z-encoded.
85 -- With any hope, the z-encoding will die soon.
86 primMname = "ghc-prim:GHCziPrim"
87
88 tcArrow :: Qual Tcon
89 tcArrow = (primMname, "(->)")
90
91 \end{code}
92
93
94
95