From a204c7f7be4bf0b29e0ff3f6e5ce04e226e2e53b Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Tue, 20 Oct 2020 11:40:51 -0700 Subject: [PATCH] [sledge] Remove unused filter_map_endo functions Reviewed By: ngorogiannis Differential Revision: D24306100 fbshipit-source-id: 324516924 --- sledge/nonstdlib/NS0.ml | 12 ------------ sledge/nonstdlib/list.ml | 1 - sledge/nonstdlib/list.mli | 4 ---- 3 files changed, 17 deletions(-) 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. *)