# HG changeset patch # User Adam Chlipala # Date 1221316410 14400 # Node ID f307cdd08d818a3071325f83a20f7594782bf081 # Parent eec65c11d3e2c44f6d84ef4e5e6894e3f989a997 Remove unneeded 'rec' in Reduce diff -r eec65c11d3e2 -r f307cdd08d81 lib/top.ur --- a/lib/top.ur Sat Sep 13 10:30:45 2008 -0400 +++ b/lib/top.ur Sat Sep 13 10:33:30 2008 -0400 @@ -8,7 +8,7 @@ fun txt (t ::: Type) (ctx ::: {Unit}) (use ::: {Type}) (sh : show t) (v : t) = cdata (show sh v) -val foldTR2 (tf1 :: Type -> Type) (tf2 :: Type -> Type) (tr :: {Type} -> Type) +fun foldTR2 (tf1 :: Type -> Type) (tf2 :: Type -> Type) (tr :: {Type} -> Type) (f : nm :: Name -> t :: Type -> rest :: {Type} -> [nm] ~ rest -> tf1 t -> tf2 t -> tr rest -> tr ([nm = t] ++ rest)) (i : tr []) = diff -r eec65c11d3e2 -r f307cdd08d81 src/reduce.sml --- 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