comparison src/core_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 766b5475477f
comparison
equal deleted inserted replaced
197:b1b9bcfd8c42 198:ab86aa858e6c
26 *) 26 *)
27 27
28 structure CoreUtil :> CORE_UTIL = struct 28 structure CoreUtil :> CORE_UTIL = struct
29 29
30 open Core 30 open Core
31
32 fun classifyDatatype xncs =
33 if List.all (fn (_, _, NONE) => true | _ => false) xncs then
34 Enum
35 else
36 Default
37 31
38 structure S = Search 32 structure S = Search
39 33
40 structure Kind = struct 34 structure Kind = struct
41 35