src/Pure/General/ord_list.ML
changeset 16680 346120708998
parent 16534 95460b6eb712
child 16811 23b9c52612db
equal deleted inserted replaced
16679:abd1461fa288 16680:346120708998
    83       | unio (lst1 as x :: xs) (lst2 as y :: ys) =
    83       | unio (lst1 as x :: xs) (lst2 as y :: ys) =
    84           (case ord (x, y) of
    84           (case ord (x, y) of
    85             LESS => x :: handle_same (unio xs) lst2
    85             LESS => x :: handle_same (unio xs) lst2
    86           | EQUAL => y :: unio xs ys
    86           | EQUAL => y :: unio xs ys
    87           | GREATER => y :: unio lst1 ys);
    87           | GREATER => y :: unio lst1 ys);
    88   in handle_same (unio list1) list2 end;
    88   in
       
    89     if subset ord (list1, list2) then list2
       
    90     else handle_same (unio list1) list2
       
    91   end;
    89 
    92 
    90 (*intersection: filter second list for elements present in first list*)
    93 (*intersection: filter second list for elements present in first list*)
    91 nonfix inter;
    94 nonfix inter;
    92 fun inter ord list1 list2 =
    95 fun inter ord list1 list2 =
    93   let
    96   let