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