diff src/elab_print.sml @ 5:258261a53842

Elaborating files
author Adam Chlipala <adamc@hcoop.net>
date Sat, 26 Jan 2008 16:02:47 -0500
parents daa4f1d7a663
children 38bf996e1c2e
line wrap: on
line diff
--- a/src/elab_print.sml	Sat Jan 26 15:29:09 2008 -0500
+++ b/src/elab_print.sml	Sat Jan 26 16:02:47 2008 -0500
@@ -128,24 +128,26 @@
 
 fun p_decl env ((d, _) : decl) =
     case d of
-        DCon (x, k, c) => box [string "con",
-                                    space,
-                                    string x,
-                                    space,
-                                    string "::",
-                                    space,
-                                    p_kind k,
-                                    space,
-                                    string "=",
-                                    space,
-                                    p_con env c]
+        DCon (x, n, k, c) => box [string "con",
+                                  space,
+                                  string x,
+                                  string "__",
+                                  string (Int.toString n),
+                                  space,
+                                  string "::",
+                                  space,
+                                  p_kind k,
+                                  space,
+                                  string "=",
+                                  space,
+                                  p_con env c]
 
 fun p_file env file =
     let
-        val (_, pds) = foldr (fn (d, (env, pds)) =>
-                                 (ElabUtil.declBinds env d,
-                                  p_decl env d :: pds))
-                             (env, []) file
+        val (_, pds) = ListUtil.mapfoldl (fn (d, env) =>
+                                             (ElabUtil.declBinds env d,
+                                              p_decl env d))
+                             env file
     in
         p_list_sep newline (fn x => x) pds
     end