Mercurial > urweb
diff src/reduce.sml @ 330:f307cdd08d81
Remove unneeded 'rec' in Reduce
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 13 Sep 2008 10:33:30 -0400 |
parents | e21d0dddda09 |
children | 075b36dbb1a4 |
line wrap: on
line diff
--- a/src/reduce.sml Sat Sep 13 10:30:45 2008 -0400 +++ b/src/reduce.sml Sat Sep 13 10:33:30 2008 -0400 @@ -148,7 +148,23 @@ and reduceExp env = U.Exp.mapB {kind = kind, con = con, exp = exp, bind = bind} env -fun decl env d = d +fun decl env d = + case d of + DValRec [vi as (_, n, _, e, _)] => + let + fun kind _ = false + fun con _ = false + fun exp e = + case e of + ENamed n' => n' = n + | _ => false + in + if U.Exp.exists {kind = kind, con = con, exp = exp} e then + d + else + DVal vi + end + | _ => d val reduce = U.File.mapB {kind = kind, con = con, exp = exp, decl = decl, bind = bind} E.empty