summaryrefslogtreecommitdiff
path: root/src/cjr.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 19:49:21 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 19:49:21 -0400
commit744cdbb9e3907db9bb01576750634c614147e1a3 (patch)
treeaecef31d4055d34a31977834cbda020811d1dfab /src/cjr.sml
parent9a9f1738a8eae9df07f97da224cd9cf45033e9dc (diff)
Datatype representation optimization
Diffstat (limited to 'src/cjr.sml')
-rw-r--r--src/cjr.sml10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cjr.sml b/src/cjr.sml
index 95a21956..d9dc51c1 100644
--- a/src/cjr.sml
+++ b/src/cjr.sml
@@ -29,11 +29,13 @@ structure Cjr = struct
type 'a located = 'a ErrorMsg.located
+datatype datatype_kind = datatype Mono.datatype_kind
+
datatype typ' =
TTop
| TFun of typ * typ
| TRecord of int
- | TDatatype of int * (string * int * typ option) list
+ | TDatatype of datatype_kind * int * (string * int * typ option) list
| TFfi of string * string
withtype typ = typ' located
@@ -46,7 +48,7 @@ datatype pat' =
PWild
| PVar of string * typ
| PPrim of Prim.t
- | PCon of patCon * pat option
+ | PCon of datatype_kind * patCon * pat option
| PRecord of (string * pat * typ) list
withtype pat = pat' located
@@ -55,7 +57,7 @@ datatype exp' =
EPrim of Prim.t
| ERel of int
| ENamed of int
- | ECon of patCon * exp option
+ | ECon of datatype_kind * patCon * exp option
| EFfi of string * string
| EFfiApp of string * string * exp list
| EApp of exp * exp
@@ -72,7 +74,7 @@ withtype exp = exp' located
datatype decl' =
DStruct of int * (string * typ) list
- | DDatatype of string * int * (string * int * typ option) list
+ | DDatatype of datatype_kind * string * int * (string * int * typ option) list
| DVal of string * int * typ * exp
| DFun of string * int * (string * typ) list * typ * exp
| DFunRec of (string * int * (string * typ) list * typ * exp) list