Shadow unsafe polymorphic functions from the standard library

This commit is contained in:
Jacques-Pascal Deplaix 2017-11-06 20:28:23 +01:00
parent 72cb078fa3
commit a8c7e14257
4 changed files with 36 additions and 2 deletions

View file

@ -1278,6 +1278,11 @@ module Assoc = struct
*)
end
let assoc = Assoc.get_exn
let assoc_opt = Assoc.get
let mem_assoc = Assoc.mem
let remove_assoc = Assoc.remove
(** {2 References on Lists} *)
module Ref = struct

View file

@ -449,14 +449,26 @@ module Assoc : sig
@since 0.17 *)
end
val assoc_opt : 'a -> ('a * 'b) t -> 'b option
(** Safe version of {!assoc}
val assoc : eq:('a -> 'a -> bool) -> 'a -> ('a * 'b) t -> 'b
(** Same as [Assoc.get_exn]
@since NEXT_RELEASE *)
val assoc_opt : eq:('a -> 'a -> bool) -> 'a -> ('a * 'b) t -> 'b option
(** Same as [Assoc.get]
@since NEXT_RELEASE *)
val assq_opt : 'a -> ('a * 'b) t -> 'b option
(** Safe version of {!assq}
@since NEXT_RELEASE *)
val mem_assoc : eq:('a -> 'a -> bool) -> 'a -> ('a * _) t -> bool
(** Same as [Assoc.mem]
@since NEXT_RELEASE *)
val remove_assoc : eq:('a -> 'a -> bool) -> 'a -> ('a * 'b) t -> ('a * 'b) t
(** Same as [Assoc.remove]
@since NEXT_RELEASE *)
(** {2 References on Lists}
@since 0.3.3 *)

View file

@ -1005,6 +1005,11 @@ module Assoc = struct
*)
end
let assoc = Assoc.get_exn
let assoc_opt = Assoc.get
let mem_assoc = Assoc.mem
let remove_assoc = Assoc.remove
(** {2 References on Lists} *)
module Ref = struct

View file

@ -346,6 +346,18 @@ module Assoc : sig
@since 0.17 *)
end
val assoc : eq:('a->'a->bool) -> 'a -> ('a,'b) Assoc.t -> 'b
(** Same as [Assoc.get_exn]. @since NEXT_RELEASE *)
val assoc_opt : eq:('a->'a->bool) -> 'a -> ('a,'b) Assoc.t -> 'b option
(** Same as [Assoc.get]. @since NEXT_RELEASE *)
val mem_assoc : eq:('a->'a->bool) -> 'a -> ('a,_) Assoc.t -> bool
(** Same as [Assoc.mem]. @since NEXT_RELEASE *)
val remove_assoc : eq:('a->'a->bool) -> 'a -> ('a,'b) Assoc.t -> ('a,'b) Assoc.t
(** Same as [Assoc.remove]. @since NEXT_RELEASE *)
(** {2 References on Lists}
@since 0.3.3 *)