reverted "id" change: The problem is rather that the "%c. f c" argument sometimes gets eta-reduced
--- 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";