src/HOL/Tools/Old_Datatype/old_datatype_data.ML
changeset 58255 9dfe8506c04d
parent 58188 cc71d2be4f0a
child 58256 08c0f0d4b9f4
equal deleted inserted replaced
58254:c1c65a805d0f 58255:9dfe8506c04d
    56 val get_info = Symtab.lookup o get_all;
    56 val get_info = Symtab.lookup o get_all;
    57 
    57 
    58 fun the_info thy name =
    58 fun the_info thy name =
    59   (case get_info thy name of
    59   (case get_info thy name of
    60     SOME info => info
    60     SOME info => info
    61   | NONE => error ("Unknown datatype " ^ quote name));
    61   | NONE => error ("Unknown old-style datatype " ^ quote name));
    62 
    62 
    63 fun info_of_constr thy (c, T) =
    63 fun info_of_constr thy (c, T) =
    64   let
    64   let
    65     val tab = Symtab.lookup_list (#constrs (Data.get thy)) c;
    65     val tab = Symtab.lookup_list (#constrs (Data.get thy)) c;
    66   in
    66   in
   167     val tycos = map fst dataTs;
   167     val tycos = map fst dataTs;
   168     val _ =
   168     val _ =
   169       if eq_set (op =) (tycos, raw_tycos) then ()
   169       if eq_set (op =) (tycos, raw_tycos) then ()
   170       else
   170       else
   171         error ("Type constructors " ^ commas_quote raw_tycos ^
   171         error ("Type constructors " ^ commas_quote raw_tycos ^
   172           " do not belong exhaustively to one mutual recursive datatype");
   172           " do not belong exhaustively to one mutually recursive old-style datatype");
   173 
   173 
   174     val (Ts, Us) = (pairself o map) Type protoTs;
   174     val (Ts, Us) = (pairself o map) Type protoTs;
   175 
   175 
   176     val names = map Long_Name.base_name tycos;
   176     val names = map Long_Name.base_name tycos;
   177     val (auxnames, _) =
   177     val (auxnames, _) =