[istd] delete unused [is_singleton]

Summary:
It started with wondering which function the "O(1)" comment was about
but I ended up deleting `is_singleton` because it's unused and it can be
easily re-implemented.

Reviewed By: ngorogiannis

Differential Revision: D21425225

fbshipit-source-id: 5ee3e189c
master
Jules Villard 5 years ago committed by Facebook GitHub Bot
parent bcb5b8356f
commit cacbd09910

@ -4,7 +4,6 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
(* Extension of Base.Container, i.e. generic definitions of container operations in terms of fold. *)
open! IStd
module F = Format
@ -17,8 +16,6 @@ let singleton_or_more ~fold t =
match acc with Empty -> Singleton item | _ -> return More ) )
let is_singleton ~fold t = match singleton_or_more ~fold t with Singleton _ -> true | _ -> false
let mem_nth ~fold t index =
With_return.with_return (fun {return} ->
let (_ : int) =

@ -8,16 +8,14 @@
open! IStd
module F = Format
(** Extension of {!Base.Container}, i.e. generic definitions of container operations in terms of a
[fold] function. *)
type 'a singleton_or_more = Empty | Singleton of 'a | More
val singleton_or_more :
fold:('t, 'a, 'a singleton_or_more) Container.fold -> 't -> 'a singleton_or_more
(* O(1) *)
val is_singleton : fold:('t, 'a, 'a singleton_or_more) Container.fold -> 't -> bool
[@@warning "-32"]
val mem_nth : fold:('t, _, int) Container.fold -> 't -> int -> bool
val forto : (int, int, 'accum) Container.fold

Loading…
Cancel
Save