comparison src/cjr.sml @ 188:8e9f97508f0d

Datatype representation optimization
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 19:49:21 -0400
parents 88d46972de53
children 890a61991263
comparison
equal deleted inserted replaced
187:fb6ed259f5bd 188:8e9f97508f0d
27 27
28 structure Cjr = struct 28 structure Cjr = struct
29 29
30 type 'a located = 'a ErrorMsg.located 30 type 'a located = 'a ErrorMsg.located
31 31
32 datatype datatype_kind = datatype Mono.datatype_kind
33
32 datatype typ' = 34 datatype typ' =
33 TTop 35 TTop
34 | TFun of typ * typ 36 | TFun of typ * typ
35 | TRecord of int 37 | TRecord of int
36 | TDatatype of int * (string * int * typ option) list 38 | TDatatype of datatype_kind * int * (string * int * typ option) list
37 | TFfi of string * string 39 | TFfi of string * string
38 40
39 withtype typ = typ' located 41 withtype typ = typ' located
40 42
41 datatype patCon = 43 datatype patCon =
44 46
45 datatype pat' = 47 datatype pat' =
46 PWild 48 PWild
47 | PVar of string * typ 49 | PVar of string * typ
48 | PPrim of Prim.t 50 | PPrim of Prim.t
49 | PCon of patCon * pat option 51 | PCon of datatype_kind * patCon * pat option
50 | PRecord of (string * pat * typ) list 52 | PRecord of (string * pat * typ) list
51 53
52 withtype pat = pat' located 54 withtype pat = pat' located
53 55
54 datatype exp' = 56 datatype exp' =
55 EPrim of Prim.t 57 EPrim of Prim.t
56 | ERel of int 58 | ERel of int
57 | ENamed of int 59 | ENamed of int
58 | ECon of patCon * exp option 60 | ECon of datatype_kind * patCon * exp option
59 | EFfi of string * string 61 | EFfi of string * string
60 | EFfiApp of string * string * exp list 62 | EFfiApp of string * string * exp list
61 | EApp of exp * exp 63 | EApp of exp * exp
62 64
63 | ERecord of int * (string * exp) list 65 | ERecord of int * (string * exp) list
70 72
71 withtype exp = exp' located 73 withtype exp = exp' located
72 74
73 datatype decl' = 75 datatype decl' =
74 DStruct of int * (string * typ) list 76 DStruct of int * (string * typ) list
75 | DDatatype of string * int * (string * int * typ option) list 77 | DDatatype of datatype_kind * string * int * (string * int * typ option) list
76 | DVal of string * int * typ * exp 78 | DVal of string * int * typ * exp
77 | DFun of string * int * (string * typ) list * typ * exp 79 | DFun of string * int * (string * typ) list * typ * exp
78 | DFunRec of (string * int * (string * typ) list * typ * exp) list 80 | DFunRec of (string * int * (string * typ) list * typ * exp) list
79 81
80 withtype decl = decl' located 82 withtype decl = decl' located