src/HOL/Tools/primrec_package.ML
changeset 19046 bc5c6c9b114e
parent 18964 67f572e03236
child 19636 50515882049e
equal deleted inserted replaced
19045:75786c2eb897 19046:bc5c6c9b114e
   225   let
   225   let
   226     val (eqns, atts) = split_list eqns_atts;
   226     val (eqns, atts) = split_list eqns_atts;
   227     val sg = Theory.sign_of thy;
   227     val sg = Theory.sign_of thy;
   228     val dt_info = DatatypePackage.get_datatypes thy;
   228     val dt_info = DatatypePackage.get_datatypes thy;
   229     val rec_eqns = foldr (process_eqn sg) [] (map snd eqns);
   229     val rec_eqns = foldr (process_eqn sg) [] (map snd eqns);
   230     val tnames = distinct (map (#1 o snd) rec_eqns);
   230     val tnames = distinct (op =) (map (#1 o snd) rec_eqns);
   231     val dts = find_dts dt_info tnames tnames;
   231     val dts = find_dts dt_info tnames tnames;
   232     val main_fns = 
   232     val main_fns = 
   233       map (fn (tname, {index, ...}) =>
   233       map (fn (tname, {index, ...}) =>
   234         (index, 
   234         (index, 
   235           (fst o the o find_first (fn f => (#1 o snd) f = tname)) rec_eqns))
   235           (fst o the o find_first (fn f => (#1 o snd) f = tname)) rec_eqns))