src/Pure/Tools/codegen_data.ML
changeset 24201 a879b30e8e86
parent 24166 7b28dc69bdbb
equal deleted inserted replaced
24200:adadbf9b42a4 24201:a879b30e8e86
   678 
   678 
   679 fun del_datatype tyco thy =
   679 fun del_datatype tyco thy =
   680   case Symtab.lookup ((the_dtyps o get_exec) thy) tyco
   680   case Symtab.lookup ((the_dtyps o get_exec) thy) tyco
   681    of SOME (vs, cos) => let
   681    of SOME (vs, cos) => let
   682         val consts = CodegenConsts.consts_of_cos thy tyco vs cos;
   682         val consts = CodegenConsts.consts_of_cos thy tyco vs cos;
   683       in map_exec_purge (SOME consts) (map_dtyps (Symtab.delete tyco)) thy end
   683       in map_exec_purge (if null consts then NONE else SOME consts)
       
   684         (map_dtyps (Symtab.delete tyco)) thy end
   684     | NONE => thy;
   685     | NONE => thy;
   685 
   686 
   686 in
   687 in
   687 
   688 
   688 fun add_datatype (tyco, (vs_cos as (vs, cos))) thy =
   689 fun add_datatype (tyco, (vs_cos as (vs, cos))) thy =