diff src/mono_util.sml @ 198:ab86aa858e6c

'Option' datatype encoding
author Adam Chlipala <adamc@hcoop.net>
date Sat, 09 Aug 2008 19:23:31 -0400
parents 890a61991263
children 326fb4686f60
line wrap: on
line diff
--- a/src/mono_util.sml	Sat Aug 09 16:54:04 2008 -0400
+++ b/src/mono_util.sml	Sat Aug 09 19:23:31 2008 -0400
@@ -29,12 +29,6 @@
 
 open Mono
 
-fun classifyDatatype xncs =
-    if List.all (fn (_, _, NONE) => true | _ => false) xncs then
-        Enum
-    else
-        Default
-
 structure S = Search
 
 structure Typ = struct
@@ -354,7 +348,7 @@
                                         DDatatype (x, n, xncs) =>
                                         let
                                             val ctx = bind (ctx, Datatype (x, n, xncs))
-                                            val t = (TDatatype (n, ref (classifyDatatype xncs, xncs)), #2 d')
+                                            val t = (TDatatype (n, ref (ElabUtil.classifyDatatype xncs, xncs)), #2 d')
                                         in
                                             foldl (fn ((x, n, to), ctx) =>
                                                       let