src/Pure/library.ML
changeset 17486 d691bf893d9f
parent 17341 ca0e5105c4b1
child 17498 d83af87bbdc5
     1.1 --- a/src/Pure/library.ML	Mon Sep 19 16:38:35 2005 +0200
     1.2 +++ b/src/Pure/library.ML	Mon Sep 19 16:39:27 2005 +0200
     1.3 @@ -225,13 +225,7 @@
     1.4  
     1.5    (*association lists -- see also Pure/General/alist.ML*)
     1.6    val assoc: (''a * 'b) list * ''a -> 'b option
     1.7 -  val assoc_int: (int * 'a) list * int -> 'a option
     1.8 -  val assoc_string: (string * 'a) list * string -> 'a option
     1.9 -  val assoc_string_int: ((string * int) * 'a) list * (string * int) -> 'a option
    1.10 -  val assocs: (''a * 'b list) list -> ''a -> 'b list
    1.11 -  val gen_assoc: ('a * 'b -> bool) -> ('b * 'c) list * 'a -> 'c option
    1.12    val overwrite: (''a * 'b) list * (''a * 'b) -> (''a * 'b) list
    1.13 -  val gen_overwrite: ('a * 'a -> bool) -> ('a * 'b) list * ('a * 'b) -> ('a * 'b) list
    1.14  
    1.15    (*lists as tables*)
    1.16    val gen_merge_lists: ('a * 'a -> bool) -> 'a list -> 'a list -> 'a list
    1.17 @@ -1043,28 +1037,6 @@
    1.18    | assoc ((keyi, xi) :: pairs, key) =
    1.19        if key = keyi then SOME xi else assoc (pairs, key);
    1.20  
    1.21 -(*association list lookup, optimized version for ints*)
    1.22 -fun assoc_int ([], (key:int)) = NONE
    1.23 -  | assoc_int ((keyi, xi) :: pairs, key) =
    1.24 -      if key = keyi then SOME xi else assoc_int (pairs, key);
    1.25 -
    1.26 -(*association list lookup, optimized version for strings*)
    1.27 -fun assoc_string ([], (key:string)) = NONE
    1.28 -  | assoc_string ((keyi, xi) :: pairs, key) =
    1.29 -      if key = keyi then SOME xi else assoc_string (pairs, key);
    1.30 -
    1.31 -(*association list lookup, optimized version for string*ints*)
    1.32 -fun assoc_string_int ([], (key:string*int)) = NONE
    1.33 -  | assoc_string_int ((keyi, xi) :: pairs, key) =
    1.34 -      if key = keyi then SOME xi else assoc_string_int (pairs, key);
    1.35 -
    1.36 -fun assocs z = curry (these o assoc) z
    1.37 -
    1.38 -(*generalized association list lookup*)
    1.39 -fun gen_assoc eq ([], key) = NONE
    1.40 -  | gen_assoc eq ((keyi, xi) :: pairs, key) =
    1.41 -      if eq (key, keyi) then SOME xi else gen_assoc eq (pairs, key);
    1.42 -
    1.43  (*association list update*)
    1.44  fun overwrite (al, p as (key, _)) =
    1.45    let fun over ((q as (keyi, _)) :: pairs) =
    1.46 @@ -1072,12 +1044,6 @@
    1.47          | over [] = [p]
    1.48    in over al end;
    1.49  
    1.50 -fun gen_overwrite eq (al, p as (key, _)) =
    1.51 -  let fun over ((q as (keyi, _)) :: pairs) =
    1.52 -            if eq (keyi, key) then p :: pairs else q :: (over pairs)
    1.53 -        | over [] = [p]
    1.54 -  in over al end;
    1.55 -
    1.56  
    1.57  (* lists as tables *)
    1.58