diff --git a/sledge/nonstdlib/NS0.ml b/sledge/nonstdlib/NS0.ml index c197ce0c3..9ca08dad7 100644 --- a/sledge/nonstdlib/NS0.ml +++ b/sledge/nonstdlib/NS0.ml @@ -76,15 +76,3 @@ let map_endo map t ~f = x' ) in if !change then t' else t - -let filter_map_endo filter_map t ~f = - let change = ref false in - let t' = - filter_map t ~f:(fun x -> - let x'_opt = f x in - ( match x'_opt with - | Some x' when x' == x -> () - | _ -> change := true ) ; - x'_opt ) - in - if !change then t' else t diff --git a/sledge/nonstdlib/list.ml b/sledge/nonstdlib/list.ml index 014a1b594..f81eb47ce 100644 --- a/sledge/nonstdlib/list.ml +++ b/sledge/nonstdlib/list.ml @@ -47,7 +47,6 @@ let fold_option xs ~init ~f = (fold xs ~init ~f:(fun acc elt -> match f acc elt with Some res -> res | None -> return None )) -let filter_map_endo t ~f = filter_map_endo filter_map t ~f let map_endo t ~f = map_endo map t ~f let rev_map_unzip xs ~f = diff --git a/sledge/nonstdlib/list.mli b/sledge/nonstdlib/list.mli index d5e8eb98d..8d9f77ef9 100644 --- a/sledge/nonstdlib/list.mli +++ b/sledge/nonstdlib/list.mli @@ -40,10 +40,6 @@ val map_endo : 'a t -> f:('a -> 'a) -> 'a t (** Like map, but specialized to require [f] to be an endofunction, which enables preserving [==] if [f] preserves [==] of every element. *) -val filter_map_endo : 'a t -> f:('a -> 'a option) -> 'a t -(** Like filter_map, but specialized to require [f] to be an endofunction, - which enables preserving [==] if [f] preserves [==] of every element. *) - val rev_map_unzip : 'a t -> f:('a -> 'b * 'c) -> 'b list * 'c list (** [rev_map_unzip ~f xs] is [unzip (rev_map ~f xs)] but more efficient. *)