summaryrefslogtreecommitdiff
path: root/src/mono_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-29 13:32:07 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-29 13:32:07 -0400
commitac7c66e703f70f57c59697fd90504539c475244d (patch)
tree12b5c0647e5d142366e9cc7d91992aa5857a1755 /src/mono_print.sml
parent4b511aa7ed5b36cb0a9adb898f881d6db0a89996 (diff)
Datatypes through monoize
Diffstat (limited to 'src/mono_print.sml')
-rw-r--r--src/mono_print.sml21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/mono_print.sml b/src/mono_print.sml
index c485e3c8..4ab38af3 100644
--- a/src/mono_print.sml
+++ b/src/mono_print.sml
@@ -162,9 +162,28 @@ fun p_vali env (x, n, t, e, s) =
p_exp env e]
end
+fun p_datatype env (x, n, cons) =
+ let
+ val env = E.pushTNamed env x n NONE
+ in
+ box [string "datatype",
+ space,
+ string x,
+ space,
+ string "=",
+ space,
+ p_list_sep (box [space, string "|", space])
+ (fn (x, n, NONE) => if !debug then (string (x ^ "__" ^ Int.toString n))
+ else string x
+ | (x, _, SOME t) => box [if !debug then (string (x ^ "__" ^ Int.toString n))
+ else string x, space, string "of", space, p_typ env t])
+ cons]
+ end
+
fun p_decl env (dAll as (d, _) : decl) =
case d of
- DVal vi => box [string "val",
+ DDatatype x => p_datatype env x
+ | DVal vi => box [string "val",
space,
p_vali env vi]
| DValRec vis =>