Skip to content

Commit

Permalink
[Docs][Belt] Categorize uncurried helpers into their dedicated sectio…
Browse files Browse the repository at this point in the history
…n, part 2

Follow-up of #2628
  • Loading branch information
chenglou committed Mar 15, 2018
1 parent c9e5bf2 commit 6f29ef4
Show file tree
Hide file tree
Showing 24 changed files with 549 additions and 438 deletions.
168 changes: 95 additions & 73 deletions jscomp/others/belt_Array.mli

Large diffs are not rendered by default.

25 changes: 15 additions & 10 deletions jscomp/others/belt_HashMapInt.mli
Expand Up @@ -3,40 +3,37 @@ type key = int


# 10 "hashmap.cppo.mli"
type 'b t
type 'b t


val make: hintSize:int -> 'b t
val make: hintSize:int -> 'b t

val clear: 'b t -> unit

val isEmpty: _ t -> bool

val set: 'a t -> key -> 'a -> unit
(** [setDone tbl k v] if [k] does not exist,
add the binding [k,v], otherwise, update the old value with the new
[v]
*)


val copy: 'a t -> 'a t

val copy: 'a t -> 'a t
val get: 'a t -> key -> 'a option

val has: 'b t -> key -> bool

val remove: 'a t -> key -> unit

val forEachU: 'b t -> (key -> 'b -> unit [@bs]) -> unit
val forEach: 'b t -> (key -> 'b -> unit) -> unit

val reduceU: 'b t -> 'c -> ('c -> key -> 'b -> 'c [@bs]) -> 'c
val reduce: 'b t -> 'c -> ('c -> key -> 'b -> 'c) -> 'c

val keepMapInPlaceU: 'a t -> (key -> 'a -> 'a option [@bs]) -> unit
val keepMapInPlace: 'a t -> (key -> 'a -> 'a option) -> unit

val size: _ t -> int

val size: _ t -> int


val toArray: 'a t -> (key * 'a) array
Expand All @@ -49,3 +46,11 @@ val logStats: _ t -> unit

val ofArray: (key * 'a) array -> 'a t
[@@ocaml.deprecated "Use fromArray instead"]


(** {1 Uncurried version} *)


val forEachU: 'b t -> (key -> 'b -> unit [@bs]) -> unit
val reduceU: 'b t -> 'c -> ('c -> key -> 'b -> 'c [@bs]) -> 'c
val keepMapInPlaceU: 'a t -> (key -> 'a -> 'a option [@bs]) -> unit
25 changes: 15 additions & 10 deletions jscomp/others/belt_HashMapString.mli
Expand Up @@ -3,40 +3,37 @@ type key = string


# 10 "hashmap.cppo.mli"
type 'b t
type 'b t


val make: hintSize:int -> 'b t
val make: hintSize:int -> 'b t

val clear: 'b t -> unit

val isEmpty: _ t -> bool

val set: 'a t -> key -> 'a -> unit
(** [setDone tbl k v] if [k] does not exist,
add the binding [k,v], otherwise, update the old value with the new
[v]
*)


val copy: 'a t -> 'a t

val copy: 'a t -> 'a t
val get: 'a t -> key -> 'a option

val has: 'b t -> key -> bool

val remove: 'a t -> key -> unit

val forEachU: 'b t -> (key -> 'b -> unit [@bs]) -> unit
val forEach: 'b t -> (key -> 'b -> unit) -> unit

val reduceU: 'b t -> 'c -> ('c -> key -> 'b -> 'c [@bs]) -> 'c
val reduce: 'b t -> 'c -> ('c -> key -> 'b -> 'c) -> 'c

val keepMapInPlaceU: 'a t -> (key -> 'a -> 'a option [@bs]) -> unit
val keepMapInPlace: 'a t -> (key -> 'a -> 'a option) -> unit

val size: _ t -> int

val size: _ t -> int


val toArray: 'a t -> (key * 'a) array
Expand All @@ -49,3 +46,11 @@ val logStats: _ t -> unit

val ofArray: (key * 'a) array -> 'a t
[@@ocaml.deprecated "Use fromArray instead"]


(** {1 Uncurried version} *)


val forEachU: 'b t -> (key -> 'b -> unit [@bs]) -> unit
val reduceU: 'b t -> 'c -> ('c -> key -> 'b -> 'c [@bs]) -> 'c
val keepMapInPlaceU: 'a t -> (key -> 'a -> 'a option [@bs]) -> unit
38 changes: 22 additions & 16 deletions jscomp/others/belt_HashSetInt.mli
@@ -1,7 +1,7 @@

# 2 "hashset.cppo.mli"
(* Copyright (C) 2017 Authors of BuckleScript
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand All @@ -19,7 +19,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
Expand All @@ -33,44 +33,50 @@
*)


# 38 "hashset.cppo.mli"
# 38
type key = int


# 44 "hashset.cppo.mli"
# 44
type t

val make: hintSize:int -> t
val make: hintSize:int -> t

val clear: t -> unit

val isEmpty: t -> bool

val add: t -> key -> unit

val copy: t -> t

val has: t -> key -> bool

val remove: t -> key -> unit

val forEachU: t -> (key -> unit [@bs]) -> unit
val forEach: t -> (key -> unit) -> unit

val reduceU: t -> 'c -> ( 'c -> key -> 'c [@bs]) -> 'c

val reduce: t -> 'c -> ( 'c -> key -> 'c) -> 'c
val size: t -> int

val size: t -> int

val logStats: t -> unit

val toArray: t -> key array
val toArray: t -> key array

val ofArray: key array -> t
val ofArray: key array -> t
[@@ocaml.deprecated "Use fromArray instead"]

val fromArray: key array -> t
val fromArray: key array -> t

val mergeMany: t -> key array -> unit

val getBucketHistogram: t -> int array


(** {1 Uncurried version} *)


val forEachU: t -> (key -> unit [@bs]) -> unit

val reduceU: t -> 'c -> ( 'c -> key -> 'c [@bs]) -> 'c
38 changes: 22 additions & 16 deletions jscomp/others/belt_HashSetString.mli
@@ -1,7 +1,7 @@

# 2 "hashset.cppo.mli"
(* Copyright (C) 2017 Authors of BuckleScript
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand All @@ -19,7 +19,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
Expand All @@ -33,44 +33,50 @@
*)


# 36 "hashset.cppo.mli"
# 36
type key = string


# 44 "hashset.cppo.mli"
# 44
type t

val make: hintSize:int -> t
val make: hintSize:int -> t

val clear: t -> unit

val isEmpty: t -> bool

val add: t -> key -> unit

val copy: t -> t

val has: t -> key -> bool

val remove: t -> key -> unit

val forEachU: t -> (key -> unit [@bs]) -> unit
val forEach: t -> (key -> unit) -> unit

val reduceU: t -> 'c -> ( 'c -> key -> 'c [@bs]) -> 'c

val reduce: t -> 'c -> ( 'c -> key -> 'c) -> 'c
val size: t -> int

val size: t -> int

val logStats: t -> unit

val toArray: t -> key array
val toArray: t -> key array

val ofArray: key array -> t
val ofArray: key array -> t
[@@ocaml.deprecated "Use fromArray instead"]

val fromArray: key array -> t
val fromArray: key array -> t

val mergeMany: t -> key array -> unit

val getBucketHistogram: t -> int array


(** {1 Uncurried version} *)


val forEachU: t -> (key -> unit [@bs]) -> unit

val reduceU: t -> 'c -> ( 'c -> key -> 'c [@bs]) -> 'c

0 comments on commit 6f29ef4

Please sign in to comment.