Mercurial > urweb
comparison src/mono_env.sml @ 198:ab86aa858e6c
'Option' datatype encoding
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 09 Aug 2008 19:23:31 -0400 |
parents | 890a61991263 |
children | 42dfb0d61cf0 |
comparison
equal
deleted
inserted
replaced
197:b1b9bcfd8c42 | 198:ab86aa858e6c |
---|---|
96 fun declBinds env (d, loc) = | 96 fun declBinds env (d, loc) = |
97 case d of | 97 case d of |
98 DDatatype (x, n, xncs) => | 98 DDatatype (x, n, xncs) => |
99 let | 99 let |
100 val env = pushDatatype env x n xncs | 100 val env = pushDatatype env x n xncs |
101 val dt = (TDatatype (n, ref (MonoUtil.classifyDatatype xncs, xncs)), loc) | 101 val dt = (TDatatype (n, ref (ElabUtil.classifyDatatype xncs, xncs)), loc) |
102 in | 102 in |
103 foldl (fn ((x', n', NONE), env) => pushENamed env x' n' dt NONE "" | 103 foldl (fn ((x', n', NONE), env) => pushENamed env x' n' dt NONE "" |
104 | ((x', n', SOME t), env) => pushENamed env x' n' (TFun (t, dt), loc) NONE "") | 104 | ((x', n', SOME t), env) => pushENamed env x' n' (TFun (t, dt), loc) NONE "") |
105 env xncs | 105 env xncs |
106 end | 106 end |