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 50288f839ce127a2e
parent 50284 7157af98ca55
child 50289 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
     1.1 --- a/src/HOL/Codatatype/Tools/bnf_fp_sugar.ML	Tue Sep 11 11:53:34 2012 +0200
     1.2 +++ b/src/HOL/Codatatype/Tools/bnf_fp_sugar.ML	Tue Sep 11 13:06:13 2012 +0200
     1.3 @@ -58,10 +58,9 @@
     1.4  fun tick v f = Term.lambda v (HOLogic.mk_prod (v, f $ v));
     1.5  
     1.6  fun tack z_name (c, v) f =
     1.7 -  let
     1.8 -    val T = fastype_of v;
     1.9 -    val z = Free (z_name, mk_sumT (T, fastype_of c))
    1.10 -  in Term.lambda z (mk_sum_case (mk_id T, Term.lambda c (f $ c)) $ z) end;
    1.11 +  let val z = Free (z_name, mk_sumT (fastype_of v, fastype_of c)) in
    1.12 +    Term.lambda z (mk_sum_case (Term.lambda v v, Term.lambda c (f $ c)) $ z)
    1.13 +  end;
    1.14  
    1.15  fun cannot_merge_types () = error "Mutually recursive types must have the same type parameters";
    1.16