reverted "id" change: The problem is rather that the "%c. f c" argument sometimes gets eta-reduced
authorblanchet
Tue, 11 Sep 2012 13:06:13 +0200
changeset 49273 f839ce127a2e
parent 49269 7157af98ca55
child 49274 ddd606ec45b9
reverted "id" change: The problem is rather that the "%c. f c" argument sometimes gets eta-reduced
src/HOL/Codatatype/Tools/bnf_fp_sugar.ML
--- a/src/HOL/Codatatype/Tools/bnf_fp_sugar.ML	Tue Sep 11 11:53:34 2012 +0200
+++ b/src/HOL/Codatatype/Tools/bnf_fp_sugar.ML	Tue Sep 11 13:06:13 2012 +0200
@@ -58,10 +58,9 @@
 fun tick v f = Term.lambda v (HOLogic.mk_prod (v, f $ v));
 
 fun tack z_name (c, v) f =
-  let
-    val T = fastype_of v;
-    val z = Free (z_name, mk_sumT (T, fastype_of c))
-  in Term.lambda z (mk_sum_case (mk_id T, Term.lambda c (f $ c)) $ z) end;
+  let val z = Free (z_name, mk_sumT (fastype_of v, fastype_of c)) in
+    Term.lambda z (mk_sum_case (Term.lambda v v, Term.lambda c (f $ c)) $ z)
+  end;
 
 fun cannot_merge_types () = error "Mutually recursive types must have the same type parameters";