Mercurial > urweb
diff src/core_util.sml @ 188:8e9f97508f0d
Datatype representation optimization
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 03 Aug 2008 19:49:21 -0400 |
parents | d11754ffe252 |
children | 9bbf4d383381 |
line wrap: on
line diff
--- a/src/core_util.sml Sun Aug 03 19:01:16 2008 -0400 +++ b/src/core_util.sml Sun Aug 03 19:49:21 2008 -0400 @@ -29,6 +29,12 @@ open Core +fun classifyDatatype xncs = + if List.all (fn (_, _, NONE) => true | _ => false) xncs then + Enum + else + Default + structure S = Search structure Kind = struct @@ -227,11 +233,11 @@ EPrim _ => S.return2 eAll | ERel _ => S.return2 eAll | ENamed _ => S.return2 eAll - | ECon (_, NONE) => S.return2 eAll - | ECon (n, SOME e) => + | ECon (_, _, NONE) => S.return2 eAll + | ECon (dk, n, SOME e) => S.map2 (mfe ctx e, fn e' => - (ECon (n, SOME e'), loc)) + (ECon (dk, n, SOME e'), loc)) | EFfi _ => S.return2 eAll | EFfiApp (m, x, es) => S.map2 (ListUtil.mapfold (fn e => mfe ctx e) es,