Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 18 additions & 24 deletions jscomp/others/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ bs_internalAVLset.cmj : bs_SortArray.cmj bs_Dict.cmj bs_Array.cmj \
bs_internalAVLset.cmi
bs_internalAVLtree.cmj : bs_SortArray.cmj bs_Dict.cmj bs_Array.cmj \
bs_internalAVLtree.cmi
bs_SetIntM.cmj : bs_internalSetInt.cmj bs_internalAVLset.cmj \
bs_SortArrayInt.cmj bs_Array.cmj bs_SetIntM.cmi
bs_Queue.cmj : bs_Array.cmj bs_Queue.cmi
bs_List.cmj : bs_Array.cmj bs_List.cmi
bs_SortArray.cmj : bs_SortArrayString.cmj bs_SortArrayInt.cmj bs_Array.cmj \
Expand All @@ -38,8 +36,6 @@ bs_internalBuckets.cmj : bs_internalBucketsType.cmj bs_Array.cmj \
bs_HashMap.cmj : bs_internalBucketsType.cmj bs_internalBuckets.cmj \
bs_HashMapString.cmj bs_HashMapInt.cmj bs_Dict.cmj bs_Array.cmj \
bs_HashMap.cmi
bs_HashMultiMap.cmj : bs_internalBucketsType.cmj bs_internalBuckets.cmj \
bs_Dict.cmj bs_Array.cmj bs_HashMultiMap.cmi
bs_HashSet.cmj : bs_internalSetBuckets.cmj bs_internalBucketsType.cmj \
bs_HashSetString.cmj bs_HashSetInt.cmj bs_Dict.cmj bs_Array.cmj \
bs_HashSet.cmi
Expand All @@ -61,28 +57,29 @@ bs_MapString.cmj : bs_internalMapString.cmj bs_internalAVLtree.cmj \
bs_Array.cmj bs_MapString.cmi
bs_MapInt.cmj : bs_internalMapInt.cmj bs_internalAVLtree.cmj bs_Array.cmj \
bs_MapInt.cmi
bs_MapStringM.cmj : bs_internalMapString.cmj bs_internalAVLtree.cmj \
bs_Array.cmj bs_MapStringM.cmi
bs_MapIntM.cmj : bs_internalMapInt.cmj bs_internalAVLtree.cmj bs_Array.cmj \
bs_MapIntM.cmi
bs_Set.cmj : bs_SetString.cmj bs_SetInt.cmj bs_SetDict.cmj bs_Dict.cmj \
bs_Array.cmj bs_Set.cmi
bs_SetM.cmj : bs_internalAVLset.cmj bs_SortArray.cmj bs_SetStringM.cmj \
bs_SetIntM.cmj bs_Dict.cmj bs_Array.cmj bs_SetM.cmi
bs_MapM.cmj : bs_internalAVLtree.cmj bs_MapStringM.cmj bs_MapIntM.cmj \
bs_Dict.cmj bs_Array.cmj bs_MapM.cmi
bs_MutableSet.cmj : bs_internalAVLset.cmj bs_SortArray.cmj \
bs_MutableSetString.cmj bs_MutableSetInt.cmj bs_Dict.cmj bs_Array.cmj \
bs_MutableSet.cmi
bs_MutableSetInt.cmj : bs_internalSetInt.cmj bs_internalAVLset.cmj \
bs_SortArrayInt.cmj bs_Array.cmj
bs_MutableSetString.cmj : bs_internalSetString.cmj bs_internalAVLset.cmj \
bs_SortArrayString.cmj bs_Array.cmj bs_MutableSetString.cmi
bs_MutableMap.cmj : bs_internalAVLtree.cmj bs_MutableMapString.cmj \
bs_MutableMapInt.cmj bs_Dict.cmj bs_Array.cmj bs_MutableMap.cmi
bs_MutableMapInt.cmj : bs_internalMapInt.cmj bs_internalAVLtree.cmj \
bs_Array.cmj bs_MutableMapInt.cmi
bs_MutableMapString.cmj : bs_internalMapString.cmj bs_internalAVLtree.cmj \
bs_Array.cmj bs_MutableMapString.cmi
bs_internalSetInt.cmj : bs_internalAVLset.cmj bs_SortArrayInt.cmj \
bs_Array.cmj
bs_internalSetString.cmj : bs_internalAVLset.cmj bs_SortArrayString.cmj \
bs_Array.cmj
bs_SetInt.cmj : bs_internalSetInt.cmj bs_internalAVLset.cmj bs_Array.cmj \
bs_SetInt.cmi
bs_SetIntM.cmj : bs_internalSetInt.cmj bs_internalAVLset.cmj \
bs_SortArrayInt.cmj bs_Array.cmj bs_SetIntM.cmi
bs_SetString.cmj : bs_internalSetString.cmj bs_internalAVLset.cmj \
bs_Array.cmj bs_SetString.cmi
bs_SetStringM.cmj : bs_internalSetString.cmj bs_internalAVLset.cmj \
bs_SortArrayString.cmj bs_Array.cmj bs_SetStringM.cmi
bs_Stack.cmj : bs_Stack.cmi
node_child_process.cmj : node.cmj
js_boolean.cmj : js_boolean.cmi
Expand All @@ -109,7 +106,6 @@ js_mapperRt.cmi :
bs_Array.cmi :
bs_internalAVLset.cmi : bs_Dict.cmi
bs_internalAVLtree.cmi : bs_Dict.cmi
bs_SetIntM.cmi :
bs_Queue.cmi :
bs_List.cmi :
bs_SortArray.cmi : bs_SortArrayString.cmi bs_SortArrayInt.cmi
Expand All @@ -120,7 +116,6 @@ bs_internalBucketsType.cmi :
bs_internalSetBuckets.cmi : bs_internalBucketsType.cmi
bs_internalBuckets.cmi : bs_internalBucketsType.cmi
bs_HashMap.cmi : bs_HashMapString.cmi bs_HashMapInt.cmi bs_Dict.cmi
bs_HashMultiMap.cmi : bs_Dict.cmi
bs_HashSet.cmi : bs_HashSetString.cmi bs_HashSetInt.cmi bs_Dict.cmi
bs_HashSetString.cmi :
bs_HashSetInt.cmi :
Expand All @@ -130,15 +125,14 @@ bs_SetDict.cmi : bs_Dict.cmi
bs_Map.cmi : bs_MapString.cmi bs_MapInt.cmi bs_MapDict.cmi bs_Dict.cmi
bs_MapString.cmi :
bs_MapInt.cmi :
bs_MapStringM.cmi :
bs_MapIntM.cmi :
bs_Set.cmi : bs_SetString.cmi bs_SetInt.cmi bs_SetDict.cmi bs_Dict.cmi
bs_SetM.cmi : bs_SetStringM.cmi bs_SetIntM.cmi bs_Dict.cmi
bs_MapM.cmi : bs_MapStringM.cmi bs_MapIntM.cmi bs_Dict.cmi
bs_MutableSet.cmi : bs_MutableSetString.cmi bs_MutableSetInt.cmj bs_Dict.cmi
bs_MutableSetString.cmi :
bs_MutableMap.cmi : bs_MutableMapString.cmi bs_MutableMapInt.cmi bs_Dict.cmi
bs_MutableMapInt.cmi :
bs_MutableMapString.cmi :
bs_SetInt.cmi :
bs_SetIntM.cmi :
bs_SetString.cmi :
bs_SetStringM.cmi :
bs_Stack.cmi :
js_boolean.cmi :
js_dict.cmi :
Expand Down
36 changes: 17 additions & 19 deletions jscomp/others/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ SOURCE_LIST= node_path node_fs node_process dict node_module js_array js_string
bs_Array\
bs_internalAVLset\
bs_internalAVLtree\
bs_SetIntM\
bs_internalMutableAVL\
bs_Queue\
bs_List\
Expand All @@ -25,7 +24,6 @@ SOURCE_LIST= node_path node_fs node_process dict node_module js_array js_string
bs_internalSetBuckets\
bs_internalBuckets\
bs_HashMap\
bs_HashMultiMap\
bs_HashSet\
bs_HashSetString\
bs_HashSetInt\
Expand All @@ -37,18 +35,18 @@ SOURCE_LIST= node_path node_fs node_process dict node_module js_array js_string
bs_internalMapString\
bs_MapString \
bs_MapInt\
bs_MapStringM \
bs_MapIntM\
bs_internalSet\
bs_Set\
bs_SetM\
bs_MapM\
bs_MutableSet\
bs_MutableSetInt\
bs_MutableSetString\
bs_MutableMap\
bs_MutableMapInt\
bs_MutableMapString\
bs_internalSetInt\
bs_internalSetString\
bs_SetInt\
bs_SetIntM\
bs_SetString\
bs_SetStringM\
bs_Stack\
node_child_process \
js_boolean js_math\
Expand Down Expand Up @@ -91,14 +89,14 @@ clean::
bs_MapInt.ml bs_MapInt.mli bs_MapString.ml bs_MapString.mli \
bs_internalSetInt.ml bs_internalSetString.ml \
bs_SetInt.ml bs_SetInt.mli bs_SetString.ml bs_SetString.mli \
bs_SetIntM.ml bs_SetIntM.mli bs_SetStringM.ml bs_SetStringM.mli\
bs_MutableSetInt.ml bs_MutableSetInt.mli bs_MutableSetString.ml bs_MutableSetString.mli\
bs_SortArrayInt.ml bs_SortArrayInt.mli bs_SortArrayString.ml bs_SortArrayString.mli\
bs_internalMapInt.ml bs_internalMapInt.mli \
bs_internalMapIntM.ml bs_internalMapIntM.mli \
bs_internalMapString.ml bs_internalMapString.mli\
bs_internalMapStringM.ml bs_internalMapStringM.mli\
bs_MapStringM.mli bs_MapStringM.ml\
bs_MapIntM.mli bs_MapIntM.ml
bs_MutableMapString.mli bs_MutableMapString.ml\
bs_MutableMapInt.mli bs_MutableMapInt.ml

ifndef BS_RELEASE_BUILD
bs_HashSetString.ml: hashset.cppo.ml
Expand All @@ -125,13 +123,13 @@ bs_MapString.mli: map.cppo.mli
cppo -D TYPE_STRING $^ > $@
bs_MapInt.mli: map.cppo.mli
cppo -D TYPE_INT $^ > $@
bs_MapStringM.mli: mapm.cppo.mli
bs_MutableMapString.mli: mapm.cppo.mli
cppo -D TYPE_STRING $^ > $@
bs_MapIntM.mli: mapm.cppo.mli
bs_MutableMapInt.mli: mapm.cppo.mli
cppo -D TYPE_INT $^ > $@
bs_MapStringM.ml: mapm.cppo.ml
bs_MutableMapString.ml: mapm.cppo.ml
cppo -D TYPE_STRING $^ > $@
bs_MapIntM.ml: mapm.cppo.ml
bs_MutableMapInt.ml: mapm.cppo.ml
cppo -D TYPE_INT $^ > $@
bs_internalMapInt.ml : internal_map.cppo.ml
cppo -D TYPE_INT $^ > $@
Expand All @@ -152,13 +150,13 @@ bs_SetInt.mli: set.cppo.mli
bs_SetString.mli: set.cppo.mli
cppo -D TYPE_STRING $^ > $@

bs_SetIntM.ml: setm.cppo.ml
bs_MutableSetInt.ml: setm.cppo.ml
cppo -D TYPE_INT $^ > $@
bs_SetStringM.ml: setm.cppo.ml
bs_MutableSetString.ml: setm.cppo.ml
cppo -D TYPE_STRING $^ > $@
bs_SetIntM.mli: setm.cppo.mli
bs_MutabgleSetInt.mli: setm.cppo.mli
cppo -D TYPE_INT $^ > $@
bs_SetStringM.mli: setm.cppo.mli
bs_MutableSetString.mli: setm.cppo.mli
cppo -D TYPE_STRING $^ > $@

bs_SortArrayInt.ml : sort.cppo.ml
Expand Down
101 changes: 44 additions & 57 deletions jscomp/others/bs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,78 +34,65 @@ module List = Bs_List
module MutableStack = Bs_Stack
module Range = Bs_Range

(** Immutable sorted set *)
(** {!Bs.Set}
The toplevel provides generic immutable set operations.
It also has three specialized inner modules
{!Bs.Set.Int} and {!Bs.Set.String}
{!Bs.Set.Dict}: This module separate date from function
which is more verbbose but slightly more efficient

*)
module Set = Bs_Set

(** The implementation detail for {!Bs.Set}, also slightly more efficient,
can also be accessed via {!Bs.Set.Dict} *)
module SetDict = Bs_SetDict

(** can also be accessed via {!Bs.Set.Int}*)
module SetInt = Bs_SetInt

(** can also be accessed via {!Bs.Set.String}*)
module SetString = Bs_SetString


module MutableSet = Bs_SetM

(** can also be accessed via {!Bs.MutableSet.Int}*)
module MutableSetInt = Bs_SetIntM

(** can also be accessed via {!Bs.MutableSet.String}*)
module MutableSetString = Bs_SetIntM


module UnorderedMutableSet = Bs_HashSet

(** can also be accessed via {!Bs.UnordedMutableSet.Int}*)
module UnorderedMutableSetInt = Bs_HashSetInt

(** can also be accessed via {!Bs.UnordedMutableSet.String}*)
module UnorderedMutableSetString = Bs_HashSetString


(** {!Bs.Map},
The toplevel provides generic immutable map operations.
It also has three specialized inner modules
{!Bs.Map.Int} and {!Bs.Map.String}
{!Bs.Map.Dict}: This module separate date from function
which is more verbbose but slightly more efficient
*)
module Map = Bs_Map

(** The implementaion detail for {!Bs.Map}, also slightly more efficient,
can also be accessed via {!Bs.Map.Dict}*)
module MapDict = Bs_MapDict

(** can also be accessed via {!Bs.Map.Int}*)
module MapInt = Bs_MapInt
(** {!Bs.MutableSet}
The toplevel provides generic mutable set operations.
It also has two specialized inner modules
{!Bs.MutableSet.Int} and {!Bs.MutableSet.String}
*)
module MutableSet = Bs_MutableSet

(** can also be accessed via {!Bs.Map.String}*)
module MapString = Bs_MapString
(** {!Bs.MutableMap}
The toplevel provides generic mutable map operations.
It also has two specialized inner modules
{!Bs.MutableMap.Int} and {!Bs.MutableMap.String}

*)
module MutableMap = Bs_MutableMap

module MutableMap = Bs_MapM

(** can also be accessed via {!Bs.MutableMap.Int}*)
module MutableMapInt = Bs_MapIntM
(** {!Bs.HashSet}
The toplevel provides generic mutable hash set operations.
It also has two specialized inner modules
{!Bs.HashSet.Int} and {!Bs.HashSet.String}
*)
module HashSet = Bs_HashSet

(** can also be accessed via {!Bs.MutableMap.String}*)
module MutableMapString = Bs_MapStringM

(** {!Bs.HashMap}
The toplevel provides generic mutable hash map operations.
It also has two specialized inner modules
{!Bs.HashMap.Int} and {!Bs.HashMap.String}
*)
module HashMap = Bs_HashMap

module UnorderedMutableMap = Bs_HashMap

(** can also be accessed via {!Bs.UnorderedMutableMap.Int}*)
module UnorderedMutableMapInt = Bs_HashMapInt

(** can also be accessed via {!Bs.UnorderedMutableMap.String}*)
module UnorderedMutableMapString = Bs_HashMapString


(** {!Bs.SortArray}
The toplevel provides some generic sort related utililties.
It also has two specialized inner modules
{!Bs.SortArray.Int} and {!Bs.SortArray.String}
*)
module SortArray = Bs_SortArray

(** can also be accessed via {!Bs.SortArray.Int}*)
module SortArrayInt = Bs_SortArrayInt

(** can also be accessed via {!Bs.SortArray.String}*)
module SortArrayString = Bs_SortArrayString




(* module HashMultiMap = Bs_HashMultiMap *)
5 changes: 3 additions & 2 deletions jscomp/others/bs_Array.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

(* Array operations *)

external length : 'a array -> int = "%array_length"
external length: 'a array -> int = "%array_length"
external size: 'a array -> int = "%array_length"
external getUnsafe: 'a array -> int -> 'a = "%array_unsafe_get"
external setUnsafe: 'a array -> int -> 'a -> unit = "%array_unsafe_set"
external getUndefined: 'a array -> int -> 'a Js.undefined = "%array_unsafe_get"
Expand Down Expand Up @@ -224,7 +225,7 @@ let map a f =
r


let keepBy a f =
let keep a f =
let l = length a in
let r = makeUninitializedUnsafe l in
let j = ref 0 in
Expand Down
6 changes: 3 additions & 3 deletions jscomp/others/bs_Array.mli
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
(***********************************************************************)


external length : 'a array -> int = "%array_length"

external length: 'a array -> int = "%array_length"
external size: 'a array -> int = "%array_length"
val get : 'a array -> int -> 'a option

val set : 'a array -> int -> 'a -> unit
Expand Down Expand Up @@ -104,7 +104,7 @@ val map: 'a array -> ('a -> 'b [@bs]) -> 'b array

val zipBy: 'a array -> 'b array -> ('a -> 'b -> 'c [@bs]) -> 'c array

val keepBy: 'a array -> ('a -> bool [@bs]) -> 'a array
val keep: 'a array -> ('a -> bool [@bs]) -> 'a array

val keepMap: 'a array -> ('a -> 'b option [@bs]) -> 'b array

Expand Down
Loading