@tellahq/rescript 10.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1717 -0
- package/COPYING +674 -0
- package/COPYING.LESSER +165 -0
- package/CREDITS.md +59 -0
- package/LICENSE +24 -0
- package/README.md +114 -0
- package/bsc +22 -0
- package/bsrefmt +16 -0
- package/darwin/bsb_helper.exe +0 -0
- package/darwin/bsc.exe +0 -0
- package/darwin/ninja.COPYING +202 -0
- package/darwin/ninja.exe +0 -0
- package/darwin/refmt.exe +0 -0
- package/darwin/rescript.exe +0 -0
- package/darwinarm64/bsb_helper.exe +0 -0
- package/darwinarm64/bsc.exe +0 -0
- package/darwinarm64/ninja.COPYING +202 -0
- package/darwinarm64/ninja.exe +0 -0
- package/darwinarm64/refmt.exe +0 -0
- package/darwinarm64/rescript.exe +0 -0
- package/docs/docson/build-schema.json +557 -0
- package/freebsd/ninja.COPYING +202 -0
- package/jscomp/stubs/ext_basic_hash_stubs.c +216 -0
- package/lib/4.06.1/bsb_helper.ml +2436 -0
- package/lib/4.06.1/bsb_helper.mli +0 -0
- package/lib/4.06.1/refmt_main3.ml +115517 -0
- package/lib/4.06.1/refmt_main3.mli +1 -0
- package/lib/4.06.1/rescript.ml +15500 -0
- package/lib/4.06.1/rescript.mli +0 -0
- package/lib/4.06.1/whole_compiler.ml +306395 -0
- package/lib/4.06.1/whole_compiler.mli +0 -0
- package/lib/bstracing +270 -0
- package/lib/es6/arg.js +717 -0
- package/lib/es6/array.js +511 -0
- package/lib/es6/arrayLabels.js +511 -0
- package/lib/es6/belt.js +57 -0
- package/lib/es6/belt_Array.js +764 -0
- package/lib/es6/belt_Float.js +16 -0
- package/lib/es6/belt_HashMap.js +280 -0
- package/lib/es6/belt_HashMapInt.js +264 -0
- package/lib/es6/belt_HashMapString.js +264 -0
- package/lib/es6/belt_HashSet.js +222 -0
- package/lib/es6/belt_HashSetInt.js +207 -0
- package/lib/es6/belt_HashSetString.js +207 -0
- package/lib/es6/belt_Id.js +71 -0
- package/lib/es6/belt_Int.js +16 -0
- package/lib/es6/belt_List.js +1512 -0
- package/lib/es6/belt_Map.js +376 -0
- package/lib/es6/belt_MapDict.js +417 -0
- package/lib/es6/belt_MapInt.js +307 -0
- package/lib/es6/belt_MapString.js +307 -0
- package/lib/es6/belt_MutableMap.js +395 -0
- package/lib/es6/belt_MutableMapInt.js +362 -0
- package/lib/es6/belt_MutableMapString.js +362 -0
- package/lib/es6/belt_MutableQueue.js +299 -0
- package/lib/es6/belt_MutableSet.js +538 -0
- package/lib/es6/belt_MutableSetInt.js +501 -0
- package/lib/es6/belt_MutableSetString.js +501 -0
- package/lib/es6/belt_MutableStack.js +137 -0
- package/lib/es6/belt_Option.js +151 -0
- package/lib/es6/belt_Range.js +109 -0
- package/lib/es6/belt_Result.js +136 -0
- package/lib/es6/belt_Set.js +314 -0
- package/lib/es6/belt_SetDict.js +362 -0
- package/lib/es6/belt_SetInt.js +359 -0
- package/lib/es6/belt_SetString.js +359 -0
- package/lib/es6/belt_SortArray.js +427 -0
- package/lib/es6/belt_SortArrayInt.js +374 -0
- package/lib/es6/belt_SortArrayString.js +374 -0
- package/lib/es6/belt_internalAVLset.js +940 -0
- package/lib/es6/belt_internalAVLtree.js +1146 -0
- package/lib/es6/belt_internalBuckets.js +287 -0
- package/lib/es6/belt_internalBucketsType.js +49 -0
- package/lib/es6/belt_internalMapInt.js +365 -0
- package/lib/es6/belt_internalMapString.js +365 -0
- package/lib/es6/belt_internalSetBuckets.js +191 -0
- package/lib/es6/belt_internalSetInt.js +209 -0
- package/lib/es6/belt_internalSetString.js +209 -0
- package/lib/es6/buffer.js +477 -0
- package/lib/es6/bytes.js +704 -0
- package/lib/es6/bytesLabels.js +704 -0
- package/lib/es6/callback.js +16 -0
- package/lib/es6/caml.js +196 -0
- package/lib/es6/caml_array.js +122 -0
- package/lib/es6/caml_array_extern.js +1 -0
- package/lib/es6/caml_bytes.js +122 -0
- package/lib/es6/caml_exceptions.js +31 -0
- package/lib/es6/caml_external_polyfill.js +32 -0
- package/lib/es6/caml_float.js +129 -0
- package/lib/es6/caml_float_extern.js +1 -0
- package/lib/es6/caml_format.js +818 -0
- package/lib/es6/caml_hash.js +101 -0
- package/lib/es6/caml_hash_primitive.js +51 -0
- package/lib/es6/caml_int32.js +28 -0
- package/lib/es6/caml_int64.js +606 -0
- package/lib/es6/caml_int64_extern.js +1 -0
- package/lib/es6/caml_js_exceptions.js +31 -0
- package/lib/es6/caml_lexer.js +258 -0
- package/lib/es6/caml_md5.js +168 -0
- package/lib/es6/caml_module.js +117 -0
- package/lib/es6/caml_nativeint_extern.js +1 -0
- package/lib/es6/caml_obj.js +413 -0
- package/lib/es6/caml_option.js +86 -0
- package/lib/es6/caml_parser.js +303 -0
- package/lib/es6/caml_splice_call.js +52 -0
- package/lib/es6/caml_string.js +23 -0
- package/lib/es6/caml_string_extern.js +1 -0
- package/lib/es6/caml_sys.js +99 -0
- package/lib/es6/caml_undefined_extern.js +1 -0
- package/lib/es6/camlinternalLazy.js +59 -0
- package/lib/es6/camlinternalMod.js +1 -0
- package/lib/es6/char.js +126 -0
- package/lib/es6/complex.js +176 -0
- package/lib/es6/curry.js +526 -0
- package/lib/es6/digest.js +118 -0
- package/lib/es6/dom.js +12 -0
- package/lib/es6/dom_storage.js +27 -0
- package/lib/es6/dom_storage2.js +1 -0
- package/lib/es6/filename.js +496 -0
- package/lib/es6/genlex.js +666 -0
- package/lib/es6/hashtbl.js +1115 -0
- package/lib/es6/hashtblLabels.js +170 -0
- package/lib/es6/int32.js +75 -0
- package/lib/es6/int64.js +70 -0
- package/lib/es6/js.js +111 -0
- package/lib/es6/js_OO.js +15 -0
- package/lib/es6/js_array.js +223 -0
- package/lib/es6/js_array2.js +1 -0
- package/lib/es6/js_bigint.js +1 -0
- package/lib/es6/js_cast.js +1 -0
- package/lib/es6/js_console.js +1 -0
- package/lib/es6/js_date.js +1 -0
- package/lib/es6/js_dict.js +85 -0
- package/lib/es6/js_exn.js +44 -0
- package/lib/es6/js_float.js +1 -0
- package/lib/es6/js_global.js +1 -0
- package/lib/es6/js_int.js +17 -0
- package/lib/es6/js_json.js +172 -0
- package/lib/es6/js_list.js +333 -0
- package/lib/es6/js_map.js +1 -0
- package/lib/es6/js_mapperRt.js +54 -0
- package/lib/es6/js_math.js +50 -0
- package/lib/es6/js_null.js +49 -0
- package/lib/es6/js_null_undefined.js +35 -0
- package/lib/es6/js_obj.js +1 -0
- package/lib/es6/js_option.js +104 -0
- package/lib/es6/js_promise.js +17 -0
- package/lib/es6/js_re.js +1 -0
- package/lib/es6/js_result.js +1 -0
- package/lib/es6/js_set.js +1 -0
- package/lib/es6/js_string.js +199 -0
- package/lib/es6/js_string2.js +1 -0
- package/lib/es6/js_typed_array.js +1733 -0
- package/lib/es6/js_typed_array2.js +39 -0
- package/lib/es6/js_types.js +77 -0
- package/lib/es6/js_undefined.js +52 -0
- package/lib/es6/js_vector.js +134 -0
- package/lib/es6/js_weakmap.js +1 -0
- package/lib/es6/js_weakset.js +1 -0
- package/lib/es6/jsx.js +1 -0
- package/lib/es6/jsxDOM.js +1 -0
- package/lib/es6/jsxDOMStyle.js +1 -0
- package/lib/es6/jsxEvent.js +59 -0
- package/lib/es6/lazy.js +44 -0
- package/lib/es6/lexing.js +217 -0
- package/lib/es6/list.js +1713 -0
- package/lib/es6/listLabels.js +1713 -0
- package/lib/es6/map.js +936 -0
- package/lib/es6/mapLabels.js +951 -0
- package/lib/es6/moreLabels.js +1931 -0
- package/lib/es6/node.js +39 -0
- package/lib/es6/node_buffer.js +1 -0
- package/lib/es6/node_child_process.js +1 -0
- package/lib/es6/node_fs.js +9 -0
- package/lib/es6/node_module.js +1 -0
- package/lib/es6/node_path.js +1 -0
- package/lib/es6/node_process.js +18 -0
- package/lib/es6/obj.js +11 -0
- package/lib/es6/package.json +1 -0
- package/lib/es6/parsing.js +237 -0
- package/lib/es6/pervasives.js +250 -0
- package/lib/es6/printexc.js +102 -0
- package/lib/es6/queue.js +181 -0
- package/lib/es6/random.js +280 -0
- package/lib/es6/set.js +955 -0
- package/lib/es6/setLabels.js +988 -0
- package/lib/es6/sort.js +168 -0
- package/lib/es6/stack.js +88 -0
- package/lib/es6/stdLabels.js +18 -0
- package/lib/es6/stream.js +496 -0
- package/lib/es6/string.js +337 -0
- package/lib/es6/stringLabels.js +337 -0
- package/lib/es6/sys.js +182 -0
- package/lib/es6/uchar.js +133 -0
- package/lib/js/arg.js +715 -0
- package/lib/js/array.js +509 -0
- package/lib/js/arrayLabels.js +509 -0
- package/lib/js/belt.js +55 -0
- package/lib/js/belt_Array.js +762 -0
- package/lib/js/belt_Float.js +14 -0
- package/lib/js/belt_HashMap.js +278 -0
- package/lib/js/belt_HashMapInt.js +262 -0
- package/lib/js/belt_HashMapString.js +262 -0
- package/lib/js/belt_HashSet.js +220 -0
- package/lib/js/belt_HashSetInt.js +205 -0
- package/lib/js/belt_HashSetString.js +205 -0
- package/lib/js/belt_Id.js +69 -0
- package/lib/js/belt_Int.js +14 -0
- package/lib/js/belt_List.js +1510 -0
- package/lib/js/belt_Map.js +374 -0
- package/lib/js/belt_MapDict.js +415 -0
- package/lib/js/belt_MapInt.js +305 -0
- package/lib/js/belt_MapString.js +305 -0
- package/lib/js/belt_MutableMap.js +393 -0
- package/lib/js/belt_MutableMapInt.js +360 -0
- package/lib/js/belt_MutableMapString.js +360 -0
- package/lib/js/belt_MutableQueue.js +297 -0
- package/lib/js/belt_MutableSet.js +536 -0
- package/lib/js/belt_MutableSetInt.js +499 -0
- package/lib/js/belt_MutableSetString.js +499 -0
- package/lib/js/belt_MutableStack.js +135 -0
- package/lib/js/belt_Option.js +149 -0
- package/lib/js/belt_Range.js +107 -0
- package/lib/js/belt_Result.js +134 -0
- package/lib/js/belt_Set.js +312 -0
- package/lib/js/belt_SetDict.js +360 -0
- package/lib/js/belt_SetInt.js +357 -0
- package/lib/js/belt_SetString.js +357 -0
- package/lib/js/belt_SortArray.js +425 -0
- package/lib/js/belt_SortArrayInt.js +372 -0
- package/lib/js/belt_SortArrayString.js +372 -0
- package/lib/js/belt_internalAVLset.js +938 -0
- package/lib/js/belt_internalAVLtree.js +1144 -0
- package/lib/js/belt_internalBuckets.js +285 -0
- package/lib/js/belt_internalBucketsType.js +47 -0
- package/lib/js/belt_internalMapInt.js +363 -0
- package/lib/js/belt_internalMapString.js +363 -0
- package/lib/js/belt_internalSetBuckets.js +189 -0
- package/lib/js/belt_internalSetInt.js +207 -0
- package/lib/js/belt_internalSetString.js +207 -0
- package/lib/js/buffer.js +475 -0
- package/lib/js/bytes.js +702 -0
- package/lib/js/bytesLabels.js +702 -0
- package/lib/js/callback.js +14 -0
- package/lib/js/caml.js +194 -0
- package/lib/js/caml_array.js +120 -0
- package/lib/js/caml_array_extern.js +1 -0
- package/lib/js/caml_bytes.js +120 -0
- package/lib/js/caml_exceptions.js +29 -0
- package/lib/js/caml_external_polyfill.js +30 -0
- package/lib/js/caml_float.js +127 -0
- package/lib/js/caml_float_extern.js +1 -0
- package/lib/js/caml_format.js +816 -0
- package/lib/js/caml_hash.js +99 -0
- package/lib/js/caml_hash_primitive.js +49 -0
- package/lib/js/caml_int32.js +26 -0
- package/lib/js/caml_int64.js +604 -0
- package/lib/js/caml_int64_extern.js +1 -0
- package/lib/js/caml_js_exceptions.js +29 -0
- package/lib/js/caml_lexer.js +256 -0
- package/lib/js/caml_md5.js +166 -0
- package/lib/js/caml_module.js +115 -0
- package/lib/js/caml_nativeint_extern.js +1 -0
- package/lib/js/caml_obj.js +411 -0
- package/lib/js/caml_option.js +84 -0
- package/lib/js/caml_parser.js +301 -0
- package/lib/js/caml_splice_call.js +50 -0
- package/lib/js/caml_string.js +21 -0
- package/lib/js/caml_string_extern.js +1 -0
- package/lib/js/caml_sys.js +97 -0
- package/lib/js/caml_undefined_extern.js +1 -0
- package/lib/js/camlinternalLazy.js +57 -0
- package/lib/js/camlinternalMod.js +1 -0
- package/lib/js/char.js +124 -0
- package/lib/js/complex.js +174 -0
- package/lib/js/curry.js +524 -0
- package/lib/js/digest.js +116 -0
- package/lib/js/dom.js +10 -0
- package/lib/js/dom_storage.js +25 -0
- package/lib/js/dom_storage2.js +1 -0
- package/lib/js/filename.js +494 -0
- package/lib/js/genlex.js +664 -0
- package/lib/js/hashtbl.js +1113 -0
- package/lib/js/hashtblLabels.js +168 -0
- package/lib/js/int32.js +73 -0
- package/lib/js/int64.js +68 -0
- package/lib/js/js.js +109 -0
- package/lib/js/js_OO.js +13 -0
- package/lib/js/js_array.js +221 -0
- package/lib/js/js_array2.js +1 -0
- package/lib/js/js_bigint.js +1 -0
- package/lib/js/js_cast.js +1 -0
- package/lib/js/js_console.js +1 -0
- package/lib/js/js_date.js +1 -0
- package/lib/js/js_dict.js +83 -0
- package/lib/js/js_exn.js +42 -0
- package/lib/js/js_float.js +1 -0
- package/lib/js/js_global.js +1 -0
- package/lib/js/js_int.js +15 -0
- package/lib/js/js_json.js +170 -0
- package/lib/js/js_list.js +331 -0
- package/lib/js/js_map.js +1 -0
- package/lib/js/js_mapperRt.js +52 -0
- package/lib/js/js_math.js +48 -0
- package/lib/js/js_null.js +47 -0
- package/lib/js/js_null_undefined.js +33 -0
- package/lib/js/js_obj.js +1 -0
- package/lib/js/js_option.js +103 -0
- package/lib/js/js_promise.js +15 -0
- package/lib/js/js_re.js +1 -0
- package/lib/js/js_result.js +1 -0
- package/lib/js/js_set.js +1 -0
- package/lib/js/js_string.js +197 -0
- package/lib/js/js_string2.js +1 -0
- package/lib/js/js_typed_array.js +1731 -0
- package/lib/js/js_typed_array2.js +37 -0
- package/lib/js/js_types.js +75 -0
- package/lib/js/js_undefined.js +50 -0
- package/lib/js/js_vector.js +132 -0
- package/lib/js/js_weakmap.js +1 -0
- package/lib/js/js_weakset.js +1 -0
- package/lib/js/jsx.js +1 -0
- package/lib/js/jsxDOM.js +1 -0
- package/lib/js/jsxDOMStyle.js +1 -0
- package/lib/js/jsxEvent.js +57 -0
- package/lib/js/lazy.js +42 -0
- package/lib/js/lexing.js +215 -0
- package/lib/js/list.js +1711 -0
- package/lib/js/listLabels.js +1711 -0
- package/lib/js/map.js +934 -0
- package/lib/js/mapLabels.js +949 -0
- package/lib/js/moreLabels.js +1929 -0
- package/lib/js/node.js +37 -0
- package/lib/js/node_buffer.js +1 -0
- package/lib/js/node_child_process.js +1 -0
- package/lib/js/node_fs.js +7 -0
- package/lib/js/node_module.js +1 -0
- package/lib/js/node_path.js +1 -0
- package/lib/js/node_process.js +16 -0
- package/lib/js/obj.js +9 -0
- package/lib/js/parsing.js +235 -0
- package/lib/js/pervasives.js +248 -0
- package/lib/js/printexc.js +100 -0
- package/lib/js/queue.js +179 -0
- package/lib/js/random.js +278 -0
- package/lib/js/set.js +953 -0
- package/lib/js/setLabels.js +986 -0
- package/lib/js/sort.js +166 -0
- package/lib/js/stack.js +86 -0
- package/lib/js/stdLabels.js +16 -0
- package/lib/js/stream.js +494 -0
- package/lib/js/string.js +335 -0
- package/lib/js/stringLabels.js +335 -0
- package/lib/js/sys.js +180 -0
- package/lib/js/uchar.js +131 -0
- package/lib/minisocket.js +93 -0
- package/lib/ocaml/arg.cmi +0 -0
- package/lib/ocaml/arg.cmt +0 -0
- package/lib/ocaml/arg.cmti +0 -0
- package/lib/ocaml/arg.ml +359 -0
- package/lib/ocaml/arg.mli +185 -0
- package/lib/ocaml/array.cmi +0 -0
- package/lib/ocaml/array.cmt +0 -0
- package/lib/ocaml/array.cmti +0 -0
- package/lib/ocaml/array.ml +307 -0
- package/lib/ocaml/array.mli +275 -0
- package/lib/ocaml/arrayLabels.cmi +0 -0
- package/lib/ocaml/arrayLabels.cmt +0 -0
- package/lib/ocaml/arrayLabels.cmti +0 -0
- package/lib/ocaml/arrayLabels.ml +307 -0
- package/lib/ocaml/arrayLabels.mli +276 -0
- package/lib/ocaml/belt.cmi +0 -0
- package/lib/ocaml/belt.cmt +0 -0
- package/lib/ocaml/belt.ml +352 -0
- package/lib/ocaml/belt_Array.cmi +0 -0
- package/lib/ocaml/belt_Array.cmt +0 -0
- package/lib/ocaml/belt_Array.cmti +0 -0
- package/lib/ocaml/belt_Array.ml +525 -0
- package/lib/ocaml/belt_Array.mli +707 -0
- package/lib/ocaml/belt_Float.cmi +0 -0
- package/lib/ocaml/belt_Float.cmt +0 -0
- package/lib/ocaml/belt_Float.cmti +0 -0
- package/lib/ocaml/belt_Float.ml +50 -0
- package/lib/ocaml/belt_Float.mli +106 -0
- package/lib/ocaml/belt_HashMap.cmi +0 -0
- package/lib/ocaml/belt_HashMap.cmt +0 -0
- package/lib/ocaml/belt_HashMap.cmti +0 -0
- package/lib/ocaml/belt_HashMap.ml +226 -0
- package/lib/ocaml/belt_HashMap.mli +436 -0
- package/lib/ocaml/belt_HashMapInt.cmi +0 -0
- package/lib/ocaml/belt_HashMapInt.cmt +0 -0
- package/lib/ocaml/belt_HashMapInt.cmti +0 -0
- package/lib/ocaml/belt_HashMapInt.ml +206 -0
- package/lib/ocaml/belt_HashMapInt.mli +50 -0
- package/lib/ocaml/belt_HashMapString.cmi +0 -0
- package/lib/ocaml/belt_HashMapString.cmt +0 -0
- package/lib/ocaml/belt_HashMapString.cmti +0 -0
- package/lib/ocaml/belt_HashMapString.ml +206 -0
- package/lib/ocaml/belt_HashMapString.mli +50 -0
- package/lib/ocaml/belt_HashSet.cmi +0 -0
- package/lib/ocaml/belt_HashSet.cmt +0 -0
- package/lib/ocaml/belt_HashSet.cmti +0 -0
- package/lib/ocaml/belt_HashSet.ml +196 -0
- package/lib/ocaml/belt_HashSet.mli +125 -0
- package/lib/ocaml/belt_HashSetInt.cmi +0 -0
- package/lib/ocaml/belt_HashSetInt.cmt +0 -0
- package/lib/ocaml/belt_HashSetInt.cmti +0 -0
- package/lib/ocaml/belt_HashSetInt.ml +155 -0
- package/lib/ocaml/belt_HashSetInt.mli +74 -0
- package/lib/ocaml/belt_HashSetString.cmi +0 -0
- package/lib/ocaml/belt_HashSetString.cmt +0 -0
- package/lib/ocaml/belt_HashSetString.cmti +0 -0
- package/lib/ocaml/belt_HashSetString.ml +156 -0
- package/lib/ocaml/belt_HashSetString.mli +74 -0
- package/lib/ocaml/belt_Id.cmi +0 -0
- package/lib/ocaml/belt_Id.cmt +0 -0
- package/lib/ocaml/belt_Id.cmti +0 -0
- package/lib/ocaml/belt_Id.ml +133 -0
- package/lib/ocaml/belt_Id.mli +171 -0
- package/lib/ocaml/belt_Int.cmi +0 -0
- package/lib/ocaml/belt_Int.cmt +0 -0
- package/lib/ocaml/belt_Int.cmti +0 -0
- package/lib/ocaml/belt_Int.ml +50 -0
- package/lib/ocaml/belt_Int.mli +103 -0
- package/lib/ocaml/belt_List.cmi +0 -0
- package/lib/ocaml/belt_List.cmt +0 -0
- package/lib/ocaml/belt_List.cmti +0 -0
- package/lib/ocaml/belt_List.ml +803 -0
- package/lib/ocaml/belt_List.mli +844 -0
- package/lib/ocaml/belt_Map.cmi +0 -0
- package/lib/ocaml/belt_Map.cmt +0 -0
- package/lib/ocaml/belt_Map.cmti +0 -0
- package/lib/ocaml/belt_Map.ml +170 -0
- package/lib/ocaml/belt_Map.mli +496 -0
- package/lib/ocaml/belt_MapDict.cmi +0 -0
- package/lib/ocaml/belt_MapDict.cmt +0 -0
- package/lib/ocaml/belt_MapDict.cmti +0 -0
- package/lib/ocaml/belt_MapDict.ml +278 -0
- package/lib/ocaml/belt_MapDict.mli +268 -0
- package/lib/ocaml/belt_MapInt.cmi +0 -0
- package/lib/ocaml/belt_MapInt.cmt +0 -0
- package/lib/ocaml/belt_MapInt.cmti +0 -0
- package/lib/ocaml/belt_MapInt.ml +169 -0
- package/lib/ocaml/belt_MapInt.mli +187 -0
- package/lib/ocaml/belt_MapString.cmi +0 -0
- package/lib/ocaml/belt_MapString.cmt +0 -0
- package/lib/ocaml/belt_MapString.cmti +0 -0
- package/lib/ocaml/belt_MapString.ml +169 -0
- package/lib/ocaml/belt_MapString.mli +187 -0
- package/lib/ocaml/belt_MutableMap.cmi +0 -0
- package/lib/ocaml/belt_MutableMap.cmt +0 -0
- package/lib/ocaml/belt_MutableMap.cmti +0 -0
- package/lib/ocaml/belt_MutableMap.ml +241 -0
- package/lib/ocaml/belt_MutableMap.mli +145 -0
- package/lib/ocaml/belt_MutableMapInt.cmi +0 -0
- package/lib/ocaml/belt_MutableMapInt.cmt +0 -0
- package/lib/ocaml/belt_MutableMapInt.cmti +0 -0
- package/lib/ocaml/belt_MutableMapInt.ml +172 -0
- package/lib/ocaml/belt_MutableMapInt.mli +135 -0
- package/lib/ocaml/belt_MutableMapString.cmi +0 -0
- package/lib/ocaml/belt_MutableMapString.cmt +0 -0
- package/lib/ocaml/belt_MutableMapString.cmti +0 -0
- package/lib/ocaml/belt_MutableMapString.ml +172 -0
- package/lib/ocaml/belt_MutableMapString.mli +135 -0
- package/lib/ocaml/belt_MutableQueue.cmi +0 -0
- package/lib/ocaml/belt_MutableQueue.cmt +0 -0
- package/lib/ocaml/belt_MutableQueue.cmti +0 -0
- package/lib/ocaml/belt_MutableQueue.ml +222 -0
- package/lib/ocaml/belt_MutableQueue.mli +116 -0
- package/lib/ocaml/belt_MutableSet.cmi +0 -0
- package/lib/ocaml/belt_MutableSet.cmt +0 -0
- package/lib/ocaml/belt_MutableSet.cmti +0 -0
- package/lib/ocaml/belt_MutableSet.ml +371 -0
- package/lib/ocaml/belt_MutableSet.mli +617 -0
- package/lib/ocaml/belt_MutableSetInt.cmi +0 -0
- package/lib/ocaml/belt_MutableSetInt.cmt +0 -0
- package/lib/ocaml/belt_MutableSetInt.cmti +0 -0
- package/lib/ocaml/belt_MutableSetInt.ml +342 -0
- package/lib/ocaml/belt_MutableSetInt.mli +124 -0
- package/lib/ocaml/belt_MutableSetString.cmi +0 -0
- package/lib/ocaml/belt_MutableSetString.cmt +0 -0
- package/lib/ocaml/belt_MutableSetString.cmti +0 -0
- package/lib/ocaml/belt_MutableSetString.ml +342 -0
- package/lib/ocaml/belt_MutableSetString.mli +124 -0
- package/lib/ocaml/belt_MutableStack.cmi +0 -0
- package/lib/ocaml/belt_MutableStack.cmt +0 -0
- package/lib/ocaml/belt_MutableStack.cmti +0 -0
- package/lib/ocaml/belt_MutableStack.ml +106 -0
- package/lib/ocaml/belt_MutableStack.mli +63 -0
- package/lib/ocaml/belt_Option.cmi +0 -0
- package/lib/ocaml/belt_Option.cmt +0 -0
- package/lib/ocaml/belt_Option.cmti +0 -0
- package/lib/ocaml/belt_Option.ml +93 -0
- package/lib/ocaml/belt_Option.mli +270 -0
- package/lib/ocaml/belt_Range.cmi +0 -0
- package/lib/ocaml/belt_Range.cmt +0 -0
- package/lib/ocaml/belt_Range.cmti +0 -0
- package/lib/ocaml/belt_Range.ml +76 -0
- package/lib/ocaml/belt_Range.mli +114 -0
- package/lib/ocaml/belt_Result.cmi +0 -0
- package/lib/ocaml/belt_Result.cmt +0 -0
- package/lib/ocaml/belt_Result.cmti +0 -0
- package/lib/ocaml/belt_Result.ml +75 -0
- package/lib/ocaml/belt_Result.mli +205 -0
- package/lib/ocaml/belt_Set.cmi +0 -0
- package/lib/ocaml/belt_Set.cmt +0 -0
- package/lib/ocaml/belt_Set.cmti +0 -0
- package/lib/ocaml/belt_Set.cppo.ml +205 -0
- package/lib/ocaml/belt_Set.cppo.mli +153 -0
- package/lib/ocaml/belt_Set.ml +164 -0
- package/lib/ocaml/belt_Set.mli +523 -0
- package/lib/ocaml/belt_SetDict.cmi +0 -0
- package/lib/ocaml/belt_SetDict.cmt +0 -0
- package/lib/ocaml/belt_SetDict.cmti +0 -0
- package/lib/ocaml/belt_SetDict.ml +237 -0
- package/lib/ocaml/belt_SetDict.mli +567 -0
- package/lib/ocaml/belt_SetInt.cmi +0 -0
- package/lib/ocaml/belt_SetInt.cmt +0 -0
- package/lib/ocaml/belt_SetInt.cmti +0 -0
- package/lib/ocaml/belt_SetInt.ml +201 -0
- package/lib/ocaml/belt_SetInt.mli +151 -0
- package/lib/ocaml/belt_SetString.cmi +0 -0
- package/lib/ocaml/belt_SetString.cmt +0 -0
- package/lib/ocaml/belt_SetString.cmti +0 -0
- package/lib/ocaml/belt_SetString.ml +201 -0
- package/lib/ocaml/belt_SetString.mli +151 -0
- package/lib/ocaml/belt_SortArray.cmi +0 -0
- package/lib/ocaml/belt_SortArray.cmt +0 -0
- package/lib/ocaml/belt_SortArray.cmti +0 -0
- package/lib/ocaml/belt_SortArray.ml +322 -0
- package/lib/ocaml/belt_SortArray.mli +146 -0
- package/lib/ocaml/belt_SortArrayInt.cmi +0 -0
- package/lib/ocaml/belt_SortArrayInt.cmt +0 -0
- package/lib/ocaml/belt_SortArrayInt.cmti +0 -0
- package/lib/ocaml/belt_SortArrayInt.ml +263 -0
- package/lib/ocaml/belt_SortArrayInt.mli +93 -0
- package/lib/ocaml/belt_SortArrayString.cmi +0 -0
- package/lib/ocaml/belt_SortArrayString.cmt +0 -0
- package/lib/ocaml/belt_SortArrayString.cmti +0 -0
- package/lib/ocaml/belt_SortArrayString.ml +263 -0
- package/lib/ocaml/belt_SortArrayString.mli +93 -0
- package/lib/ocaml/belt_internalAVLset.cmt +0 -0
- package/lib/ocaml/belt_internalAVLset.cmti +0 -0
- package/lib/ocaml/belt_internalAVLset.ml +665 -0
- package/lib/ocaml/belt_internalAVLset.mli +124 -0
- package/lib/ocaml/belt_internalAVLtree.cmt +0 -0
- package/lib/ocaml/belt_internalAVLtree.cmti +0 -0
- package/lib/ocaml/belt_internalAVLtree.ml +762 -0
- package/lib/ocaml/belt_internalAVLtree.mli +215 -0
- package/lib/ocaml/belt_internalBuckets.cmt +0 -0
- package/lib/ocaml/belt_internalBuckets.cmti +0 -0
- package/lib/ocaml/belt_internalBuckets.ml +218 -0
- package/lib/ocaml/belt_internalBuckets.mli +57 -0
- package/lib/ocaml/belt_internalBucketsType.cmt +0 -0
- package/lib/ocaml/belt_internalBucketsType.cmti +0 -0
- package/lib/ocaml/belt_internalBucketsType.ml +59 -0
- package/lib/ocaml/belt_internalBucketsType.mli +46 -0
- package/lib/ocaml/belt_internalMapInt.cmt +0 -0
- package/lib/ocaml/belt_internalMapInt.ml +227 -0
- package/lib/ocaml/belt_internalMapString.cmt +0 -0
- package/lib/ocaml/belt_internalMapString.ml +227 -0
- package/lib/ocaml/belt_internalSetBuckets.cmt +0 -0
- package/lib/ocaml/belt_internalSetBuckets.cmti +0 -0
- package/lib/ocaml/belt_internalSetBuckets.ml +157 -0
- package/lib/ocaml/belt_internalSetBuckets.mli +47 -0
- package/lib/ocaml/belt_internalSetInt.cmt +0 -0
- package/lib/ocaml/belt_internalSetInt.ml +129 -0
- package/lib/ocaml/belt_internalSetString.cmt +0 -0
- package/lib/ocaml/belt_internalSetString.ml +129 -0
- package/lib/ocaml/belt_internals.cmti +0 -0
- package/lib/ocaml/belt_internals.mli +79 -0
- package/lib/ocaml/buffer.cmi +0 -0
- package/lib/ocaml/buffer.cmt +0 -0
- package/lib/ocaml/buffer.cmti +0 -0
- package/lib/ocaml/buffer.ml +250 -0
- package/lib/ocaml/buffer.mli +149 -0
- package/lib/ocaml/bytes.cmi +0 -0
- package/lib/ocaml/bytes.cmt +0 -0
- package/lib/ocaml/bytes.cmti +0 -0
- package/lib/ocaml/bytes.ml +431 -0
- package/lib/ocaml/bytes.mli +430 -0
- package/lib/ocaml/bytesLabels.cmi +0 -0
- package/lib/ocaml/bytesLabels.cmt +0 -0
- package/lib/ocaml/bytesLabels.cmti +0 -0
- package/lib/ocaml/bytesLabels.ml +428 -0
- package/lib/ocaml/bytesLabels.mli +276 -0
- package/lib/ocaml/callback.cmi +0 -0
- package/lib/ocaml/callback.cmt +0 -0
- package/lib/ocaml/callback.cmti +0 -0
- package/lib/ocaml/callback.ml +20 -0
- package/lib/ocaml/callback.mli +34 -0
- package/lib/ocaml/camlinternalLazy.cmi +0 -0
- package/lib/ocaml/camlinternalLazy.cmt +0 -0
- package/lib/ocaml/camlinternalLazy.cmti +0 -0
- package/lib/ocaml/camlinternalLazy.ml +89 -0
- package/lib/ocaml/camlinternalLazy.mli +27 -0
- package/lib/ocaml/camlinternalMod.cmi +0 -0
- package/lib/ocaml/camlinternalMod.cmt +0 -0
- package/lib/ocaml/camlinternalMod.cmti +0 -0
- package/lib/ocaml/camlinternalMod.ml +21 -0
- package/lib/ocaml/camlinternalMod.mli +25 -0
- package/lib/ocaml/char.cmi +0 -0
- package/lib/ocaml/char.cmt +0 -0
- package/lib/ocaml/char.cmti +0 -0
- package/lib/ocaml/char.ml +76 -0
- package/lib/ocaml/char.mli +72 -0
- package/lib/ocaml/complex.cmi +0 -0
- package/lib/ocaml/complex.cmt +0 -0
- package/lib/ocaml/complex.cmti +0 -0
- package/lib/ocaml/complex.ml +87 -0
- package/lib/ocaml/complex.mli +86 -0
- package/lib/ocaml/digest.cmi +0 -0
- package/lib/ocaml/digest.cmt +0 -0
- package/lib/ocaml/digest.cmti +0 -0
- package/lib/ocaml/digest.ml +66 -0
- package/lib/ocaml/digest.mli +68 -0
- package/lib/ocaml/dom.cmi +0 -0
- package/lib/ocaml/dom.cmt +0 -0
- package/lib/ocaml/dom.ml +296 -0
- package/lib/ocaml/dom_storage.cmi +0 -0
- package/lib/ocaml/dom_storage.cmt +0 -0
- package/lib/ocaml/dom_storage.ml +22 -0
- package/lib/ocaml/dom_storage2.cmi +0 -0
- package/lib/ocaml/dom_storage2.cmt +0 -0
- package/lib/ocaml/dom_storage2.ml +11 -0
- package/lib/ocaml/filename.cmi +0 -0
- package/lib/ocaml/filename.cmt +0 -0
- package/lib/ocaml/filename.cmti +0 -0
- package/lib/ocaml/filename.ml +233 -0
- package/lib/ocaml/filename.mli +134 -0
- package/lib/ocaml/genlex.cmi +0 -0
- package/lib/ocaml/genlex.cmt +0 -0
- package/lib/ocaml/genlex.cmti +0 -0
- package/lib/ocaml/genlex.ml +201 -0
- package/lib/ocaml/genlex.mli +73 -0
- package/lib/ocaml/hashmap.cppo.ml +214 -0
- package/lib/ocaml/hashmap.cppo.mli +54 -0
- package/lib/ocaml/hashset.cppo.ml +165 -0
- package/lib/ocaml/hashset.cppo.mli +77 -0
- package/lib/ocaml/hashtbl.cmi +0 -0
- package/lib/ocaml/hashtbl.cmt +0 -0
- package/lib/ocaml/hashtbl.cmti +0 -0
- package/lib/ocaml/hashtbl.ml +541 -0
- package/lib/ocaml/hashtbl.mli +411 -0
- package/lib/ocaml/hashtblLabels.cmi +0 -0
- package/lib/ocaml/hashtblLabels.cmt +0 -0
- package/lib/ocaml/hashtblLabels.ml +130 -0
- package/lib/ocaml/int32.cmi +0 -0
- package/lib/ocaml/int32.cmt +0 -0
- package/lib/ocaml/int32.cmti +0 -0
- package/lib/ocaml/int32.ml +64 -0
- package/lib/ocaml/int32.mli +186 -0
- package/lib/ocaml/int64.cmi +0 -0
- package/lib/ocaml/int64.cmt +0 -0
- package/lib/ocaml/int64.cmti +0 -0
- package/lib/ocaml/int64.ml +72 -0
- package/lib/ocaml/int64.mli +197 -0
- package/lib/ocaml/internal_map.cppo.ml +230 -0
- package/lib/ocaml/internal_set.cppo.ml +134 -0
- package/lib/ocaml/js.cmi +0 -0
- package/lib/ocaml/js.cmt +0 -0
- package/lib/ocaml/js.ml +313 -0
- package/lib/ocaml/js_OO.cmi +0 -0
- package/lib/ocaml/js_OO.cmt +0 -0
- package/lib/ocaml/js_OO.ml +180 -0
- package/lib/ocaml/js_array.cmi +0 -0
- package/lib/ocaml/js_array.cmt +0 -0
- package/lib/ocaml/js_array.ml +970 -0
- package/lib/ocaml/js_array2.cmi +0 -0
- package/lib/ocaml/js_array2.cmt +0 -0
- package/lib/ocaml/js_array2.ml +1065 -0
- package/lib/ocaml/js_bigint.cmi +0 -0
- package/lib/ocaml/js_bigint.cmt +0 -0
- package/lib/ocaml/js_bigint.ml +3 -0
- package/lib/ocaml/js_cast.cmi +0 -0
- package/lib/ocaml/js_cast.cmt +0 -0
- package/lib/ocaml/js_cast.cmti +0 -0
- package/lib/ocaml/js_cast.ml +29 -0
- package/lib/ocaml/js_cast.mli +45 -0
- package/lib/ocaml/js_console.cmi +0 -0
- package/lib/ocaml/js_console.cmt +0 -0
- package/lib/ocaml/js_console.ml +51 -0
- package/lib/ocaml/js_date.cmi +0 -0
- package/lib/ocaml/js_date.cmt +0 -0
- package/lib/ocaml/js_date.ml +1263 -0
- package/lib/ocaml/js_dict.cmi +0 -0
- package/lib/ocaml/js_dict.cmt +0 -0
- package/lib/ocaml/js_dict.cmti +0 -0
- package/lib/ocaml/js_dict.ml +114 -0
- package/lib/ocaml/js_dict.mli +152 -0
- package/lib/ocaml/js_exn.cmi +0 -0
- package/lib/ocaml/js_exn.cmt +0 -0
- package/lib/ocaml/js_exn.cmti +0 -0
- package/lib/ocaml/js_exn.ml +102 -0
- package/lib/ocaml/js_exn.mli +79 -0
- package/lib/ocaml/js_float.cmi +0 -0
- package/lib/ocaml/js_float.cmt +0 -0
- package/lib/ocaml/js_float.ml +294 -0
- package/lib/ocaml/js_global.cmi +0 -0
- package/lib/ocaml/js_global.cmt +0 -0
- package/lib/ocaml/js_global.ml +185 -0
- package/lib/ocaml/js_int.cmi +0 -0
- package/lib/ocaml/js_int.cmt +0 -0
- package/lib/ocaml/js_int.ml +158 -0
- package/lib/ocaml/js_json.cmi +0 -0
- package/lib/ocaml/js_json.cmt +0 -0
- package/lib/ocaml/js_json.cmti +0 -0
- package/lib/ocaml/js_json.ml +195 -0
- package/lib/ocaml/js_json.mli +244 -0
- package/lib/ocaml/js_list.cmi +0 -0
- package/lib/ocaml/js_list.cmt +0 -0
- package/lib/ocaml/js_list.cmti +0 -0
- package/lib/ocaml/js_list.ml +174 -0
- package/lib/ocaml/js_list.mli +72 -0
- package/lib/ocaml/js_map.cmi +0 -0
- package/lib/ocaml/js_map.cmt +0 -0
- package/lib/ocaml/js_map.ml +3 -0
- package/lib/ocaml/js_mapperRt.cmi +0 -0
- package/lib/ocaml/js_mapperRt.cmt +0 -0
- package/lib/ocaml/js_mapperRt.cmti +0 -0
- package/lib/ocaml/js_mapperRt.ml +50 -0
- package/lib/ocaml/js_mapperRt.mli +44 -0
- package/lib/ocaml/js_math.cmi +0 -0
- package/lib/ocaml/js_math.cmt +0 -0
- package/lib/ocaml/js_math.ml +626 -0
- package/lib/ocaml/js_null.cmi +0 -0
- package/lib/ocaml/js_null.cmt +0 -0
- package/lib/ocaml/js_null.cmti +0 -0
- package/lib/ocaml/js_null.ml +57 -0
- package/lib/ocaml/js_null.mli +87 -0
- package/lib/ocaml/js_null_undefined.cmi +0 -0
- package/lib/ocaml/js_null_undefined.cmt +0 -0
- package/lib/ocaml/js_null_undefined.cmti +0 -0
- package/lib/ocaml/js_null_undefined.ml +50 -0
- package/lib/ocaml/js_null_undefined.mli +85 -0
- package/lib/ocaml/js_obj.cmi +0 -0
- package/lib/ocaml/js_obj.cmt +0 -0
- package/lib/ocaml/js_obj.ml +100 -0
- package/lib/ocaml/js_option.cmi +0 -0
- package/lib/ocaml/js_option.cmt +0 -0
- package/lib/ocaml/js_option.cmti +0 -0
- package/lib/ocaml/js_option.ml +203 -0
- package/lib/ocaml/js_option.mli +52 -0
- package/lib/ocaml/js_promise.cmi +0 -0
- package/lib/ocaml/js_promise.cmt +0 -0
- package/lib/ocaml/js_promise.ml +100 -0
- package/lib/ocaml/js_re.cmi +0 -0
- package/lib/ocaml/js_re.cmt +0 -0
- package/lib/ocaml/js_re.ml +184 -0
- package/lib/ocaml/js_result.cmi +0 -0
- package/lib/ocaml/js_result.cmt +0 -0
- package/lib/ocaml/js_result.cmti +0 -0
- package/lib/ocaml/js_result.ml +28 -0
- package/lib/ocaml/js_result.mli +28 -0
- package/lib/ocaml/js_set.cmi +0 -0
- package/lib/ocaml/js_set.cmt +0 -0
- package/lib/ocaml/js_set.ml +3 -0
- package/lib/ocaml/js_string.cmi +0 -0
- package/lib/ocaml/js_string.cmt +0 -0
- package/lib/ocaml/js_string.ml +914 -0
- package/lib/ocaml/js_string2.cmi +0 -0
- package/lib/ocaml/js_string2.cmt +0 -0
- package/lib/ocaml/js_string2.ml +912 -0
- package/lib/ocaml/js_typed_array.cmi +0 -0
- package/lib/ocaml/js_typed_array.cmt +0 -0
- package/lib/ocaml/js_typed_array.cppo.ml +429 -0
- package/lib/ocaml/js_typed_array.ml +1405 -0
- package/lib/ocaml/js_typed_array2.cmi +0 -0
- package/lib/ocaml/js_typed_array2.cmt +0 -0
- package/lib/ocaml/js_typed_array2.cppo.ml +296 -0
- package/lib/ocaml/js_typed_array2.ml +1269 -0
- package/lib/ocaml/js_types.cmi +0 -0
- package/lib/ocaml/js_types.cmt +0 -0
- package/lib/ocaml/js_types.cmti +0 -0
- package/lib/ocaml/js_types.ml +118 -0
- package/lib/ocaml/js_types.mli +78 -0
- package/lib/ocaml/js_undefined.cmi +0 -0
- package/lib/ocaml/js_undefined.cmt +0 -0
- package/lib/ocaml/js_undefined.cmti +0 -0
- package/lib/ocaml/js_undefined.ml +59 -0
- package/lib/ocaml/js_undefined.mli +92 -0
- package/lib/ocaml/js_vector.cmi +0 -0
- package/lib/ocaml/js_vector.cmt +0 -0
- package/lib/ocaml/js_vector.cmti +0 -0
- package/lib/ocaml/js_vector.ml +143 -0
- package/lib/ocaml/js_vector.mli +92 -0
- package/lib/ocaml/js_weakmap.cmi +0 -0
- package/lib/ocaml/js_weakmap.cmt +0 -0
- package/lib/ocaml/js_weakmap.ml +3 -0
- package/lib/ocaml/js_weakset.cmi +0 -0
- package/lib/ocaml/js_weakset.cmt +0 -0
- package/lib/ocaml/js_weakset.ml +3 -0
- package/lib/ocaml/jsx.cmi +0 -0
- package/lib/ocaml/jsx.cmt +0 -0
- package/lib/ocaml/jsx.ml +39 -0
- package/lib/ocaml/jsxDOM.cmi +0 -0
- package/lib/ocaml/jsxDOM.cmt +0 -0
- package/lib/ocaml/jsxDOM.ml +2087 -0
- package/lib/ocaml/jsxDOMStyle.cmi +0 -0
- package/lib/ocaml/jsxDOMStyle.cmt +0 -0
- package/lib/ocaml/jsxDOMStyle.ml +777 -0
- package/lib/ocaml/jsxEvent.cmi +0 -0
- package/lib/ocaml/jsxEvent.cmt +0 -0
- package/lib/ocaml/jsxEvent.ml +358 -0
- package/lib/ocaml/lazy.cmi +0 -0
- package/lib/ocaml/lazy.cmt +0 -0
- package/lib/ocaml/lazy.cmti +0 -0
- package/lib/ocaml/lazy.ml +70 -0
- package/lib/ocaml/lazy.mli +95 -0
- package/lib/ocaml/lexing.cmi +0 -0
- package/lib/ocaml/lexing.cmt +0 -0
- package/lib/ocaml/lexing.cmti +0 -0
- package/lib/ocaml/lexing.ml +230 -0
- package/lib/ocaml/lexing.mli +172 -0
- package/lib/ocaml/list.cmi +0 -0
- package/lib/ocaml/list.cmt +0 -0
- package/lib/ocaml/list.cmti +0 -0
- package/lib/ocaml/list.ml +485 -0
- package/lib/ocaml/list.mli +347 -0
- package/lib/ocaml/listLabels.cmi +0 -0
- package/lib/ocaml/listLabels.cmt +0 -0
- package/lib/ocaml/listLabels.cmti +0 -0
- package/lib/ocaml/listLabels.ml +485 -0
- package/lib/ocaml/listLabels.mli +353 -0
- package/lib/ocaml/map.cmi +0 -0
- package/lib/ocaml/map.cmt +0 -0
- package/lib/ocaml/map.cmti +0 -0
- package/lib/ocaml/map.cppo.ml +174 -0
- package/lib/ocaml/map.cppo.mli +191 -0
- package/lib/ocaml/map.ml +480 -0
- package/lib/ocaml/map.mli +315 -0
- package/lib/ocaml/mapLabels.cmi +0 -0
- package/lib/ocaml/mapLabels.cmt +0 -0
- package/lib/ocaml/mapLabels.ml +480 -0
- package/lib/ocaml/mapm.cppo.ml +177 -0
- package/lib/ocaml/mapm.cppo.mli +138 -0
- package/lib/ocaml/moreLabels.cmi +0 -0
- package/lib/ocaml/moreLabels.cmt +0 -0
- package/lib/ocaml/moreLabels.cmti +0 -0
- package/lib/ocaml/moreLabels.ml +22 -0
- package/lib/ocaml/moreLabels.mli +198 -0
- package/lib/ocaml/node.cmi +0 -0
- package/lib/ocaml/node.cmt +0 -0
- package/lib/ocaml/node.ml +84 -0
- package/lib/ocaml/node_buffer.cmi +0 -0
- package/lib/ocaml/node_buffer.cmt +0 -0
- package/lib/ocaml/node_buffer.ml +47 -0
- package/lib/ocaml/node_child_process.cmi +0 -0
- package/lib/ocaml/node_child_process.cmt +0 -0
- package/lib/ocaml/node_child_process.ml +50 -0
- package/lib/ocaml/node_fs.cmi +0 -0
- package/lib/ocaml/node_fs.cmt +0 -0
- package/lib/ocaml/node_fs.ml +153 -0
- package/lib/ocaml/node_module.cmi +0 -0
- package/lib/ocaml/node_module.cmt +0 -0
- package/lib/ocaml/node_module.ml +29 -0
- package/lib/ocaml/node_path.cmi +0 -0
- package/lib/ocaml/node_path.cmt +0 -0
- package/lib/ocaml/node_path.ml +71 -0
- package/lib/ocaml/node_process.cmi +0 -0
- package/lib/ocaml/node_process.cmt +0 -0
- package/lib/ocaml/node_process.cmti +0 -0
- package/lib/ocaml/node_process.ml +59 -0
- package/lib/ocaml/node_process.mli +48 -0
- package/lib/ocaml/obj.cmi +0 -0
- package/lib/ocaml/obj.cmt +0 -0
- package/lib/ocaml/obj.cmti +0 -0
- package/lib/ocaml/obj.ml +29 -0
- package/lib/ocaml/obj.mli +62 -0
- package/lib/ocaml/parsing.cmi +0 -0
- package/lib/ocaml/parsing.cmt +0 -0
- package/lib/ocaml/parsing.cmti +0 -0
- package/lib/ocaml/parsing.ml +212 -0
- package/lib/ocaml/parsing.mli +105 -0
- package/lib/ocaml/pervasives.cmi +0 -0
- package/lib/ocaml/pervasives.cmt +0 -0
- package/lib/ocaml/pervasives.cmti +0 -0
- package/lib/ocaml/pervasives.ml +297 -0
- package/lib/ocaml/pervasives.mli +771 -0
- package/lib/ocaml/printexc.cmi +0 -0
- package/lib/ocaml/printexc.cmt +0 -0
- package/lib/ocaml/printexc.cmti +0 -0
- package/lib/ocaml/printexc.ml +79 -0
- package/lib/ocaml/printexc.mli +57 -0
- package/lib/ocaml/queue.cmi +0 -0
- package/lib/ocaml/queue.cmt +0 -0
- package/lib/ocaml/queue.cmti +0 -0
- package/lib/ocaml/queue.ml +132 -0
- package/lib/ocaml/queue.mli +82 -0
- package/lib/ocaml/random.cmi +0 -0
- package/lib/ocaml/random.cmt +0 -0
- package/lib/ocaml/random.cmti +0 -0
- package/lib/ocaml/random.ml +273 -0
- package/lib/ocaml/random.mli +102 -0
- package/lib/ocaml/set.cmi +0 -0
- package/lib/ocaml/set.cmt +0 -0
- package/lib/ocaml/set.cmti +0 -0
- package/lib/ocaml/set.ml +526 -0
- package/lib/ocaml/set.mli +266 -0
- package/lib/ocaml/setLabels.cmi +0 -0
- package/lib/ocaml/setLabels.cmt +0 -0
- package/lib/ocaml/setLabels.ml +526 -0
- package/lib/ocaml/setm.cppo.ml +346 -0
- package/lib/ocaml/setm.cppo.mli +126 -0
- package/lib/ocaml/sort.cmi +0 -0
- package/lib/ocaml/sort.cmt +0 -0
- package/lib/ocaml/sort.cmti +0 -0
- package/lib/ocaml/sort.cppo.ml +267 -0
- package/lib/ocaml/sort.cppo.mli +96 -0
- package/lib/ocaml/sort.ml +99 -0
- package/lib/ocaml/sort.mli +44 -0
- package/lib/ocaml/stack.cmi +0 -0
- package/lib/ocaml/stack.cmt +0 -0
- package/lib/ocaml/stack.cmti +0 -0
- package/lib/ocaml/stack.ml +44 -0
- package/lib/ocaml/stack.mli +63 -0
- package/lib/ocaml/stdLabels.cmi +0 -0
- package/lib/ocaml/stdLabels.cmt +0 -0
- package/lib/ocaml/stdLabels.cmti +0 -0
- package/lib/ocaml/stdLabels.ml +24 -0
- package/lib/ocaml/stdLabels.mli +29 -0
- package/lib/ocaml/stream.cmi +0 -0
- package/lib/ocaml/stream.cmt +0 -0
- package/lib/ocaml/stream.cmti +0 -0
- package/lib/ocaml/stream.ml +213 -0
- package/lib/ocaml/stream.mli +108 -0
- package/lib/ocaml/string.cmi +0 -0
- package/lib/ocaml/string.cmt +0 -0
- package/lib/ocaml/string.cmti +0 -0
- package/lib/ocaml/string.ml +190 -0
- package/lib/ocaml/string.mli +286 -0
- package/lib/ocaml/stringLabels.cmi +0 -0
- package/lib/ocaml/stringLabels.cmt +0 -0
- package/lib/ocaml/stringLabels.cmti +0 -0
- package/lib/ocaml/stringLabels.ml +190 -0
- package/lib/ocaml/stringLabels.mli +241 -0
- package/lib/ocaml/sys.cmi +0 -0
- package/lib/ocaml/sys.cmt +0 -0
- package/lib/ocaml/sys.cmti +0 -0
- package/lib/ocaml/sys.ml +135 -0
- package/lib/ocaml/sys.mli +333 -0
- package/lib/ocaml/uchar.cmi +0 -0
- package/lib/ocaml/uchar.cmt +0 -0
- package/lib/ocaml/uchar.cmti +0 -0
- package/lib/ocaml/uchar.ml +58 -0
- package/lib/ocaml/uchar.mli +98 -0
- package/linux/bsb_helper.exe +0 -0
- package/linux/bsc.exe +0 -0
- package/linux/ninja.COPYING +202 -0
- package/linux/ninja.exe +0 -0
- package/linux/refmt.exe +0 -0
- package/linux/rescript.exe +0 -0
- package/openbsd/.keep +0 -0
- package/package.json +71 -0
- package/rescript +591 -0
- package/scripts/LICENSE.ml +27 -0
- package/scripts/bin_path.js +38 -0
- package/scripts/buckle_lto.js +55 -0
- package/scripts/build_sorted.ml +233 -0
- package/scripts/buildocaml.js +102 -0
- package/scripts/caml_oo_curry_gen.ml +71 -0
- package/scripts/checkUnused.js +63 -0
- package/scripts/ciTest.js +172 -0
- package/scripts/config.js +24 -0
- package/scripts/cover.sh +3 -0
- package/scripts/curry_gen.ml +167 -0
- package/scripts/dbg +13 -0
- package/scripts/dedupe.js +44 -0
- package/scripts/doc_gen.js +117 -0
- package/scripts/install.js +237 -0
- package/scripts/installUtils.js +61 -0
- package/scripts/js_internal_gen.js +135 -0
- package/scripts/jsconfig.json +12 -0
- package/scripts/littlecase.js +21 -0
- package/scripts/ninja.js +1980 -0
- package/scripts/ninjaFactory.js +36 -0
- package/scripts/pack.js +107 -0
- package/scripts/prebuilt.js +99 -0
- package/scripts/release.js +41 -0
- package/scripts/repl.js +151 -0
- package/scripts/rescript_arg.js +168 -0
- package/scripts/rescript_convert.js +128 -0
- package/scripts/rescript_dump.js +48 -0
- package/scripts/rescript_format.js +194 -0
- package/scripts/shake.js +138 -0
- package/scripts/tasks.js +149 -0
- package/scripts/test.sh +3 -0
- package/scripts/tmp.js +98 -0
- package/scripts/validate.js +41 -0
- package/vendor/ninja.tar.gz +0 -0
- package/vendor/ocaml.tar.gz +0 -0
- package/win32/bsb_helper.exe +0 -0
- package/win32/bsc.exe +0 -0
- package/win32/ninja.COPYING +202 -0
- package/win32/ninja.exe +0 -0
- package/win32/refmt.exe +0 -0
- package/win32/rescript.exe +0 -0
|
@@ -0,0 +1,1065 @@
|
|
|
1
|
+
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
|
|
2
|
+
*
|
|
3
|
+
* This program is free software: you can redistribute it and/or modify
|
|
4
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
5
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
6
|
+
* (at your option) any later version.
|
|
7
|
+
*
|
|
8
|
+
* In addition to the permissions granted to you by the LGPL, you may combine
|
|
9
|
+
* or link a "work that uses the Library" with a publicly distributed version
|
|
10
|
+
* of this file to produce a combined library or application, then distribute
|
|
11
|
+
* that combined work under the terms of your choosing, with no requirement
|
|
12
|
+
* to comply with the obligations normally placed on you by section 4 of the
|
|
13
|
+
* LGPL version 3 (or the corresponding section of a later version of the LGPL
|
|
14
|
+
* should you choose to use a later version).
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU Lesser General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
22
|
+
* along with this program; if not, write to the Free Software
|
|
23
|
+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
|
|
24
|
+
|
|
25
|
+
(**
|
|
26
|
+
Provides bindings to JavaScript’s `Array` functions. These bindings are optimized for pipe-first (`->`), where the array to be processed is the first parameter in the function.
|
|
27
|
+
|
|
28
|
+
Here is an example to find the sum of squares of all even numbers in an array.
|
|
29
|
+
Without pipe first, we must call the functions in reverse order:
|
|
30
|
+
|
|
31
|
+
```res example
|
|
32
|
+
let isEven = x => mod(x, 2) == 0
|
|
33
|
+
let square = x => x * x
|
|
34
|
+
let result = {
|
|
35
|
+
open Js.Array2
|
|
36
|
+
reduce(map(filter([5, 2, 3, 4, 1], isEven), square), \"+", 0)
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
With pipe first, we call the functions in the “natural” order:
|
|
41
|
+
|
|
42
|
+
```res example
|
|
43
|
+
let isEven = x => mod(x, 2) == 0
|
|
44
|
+
let square = x => x * x
|
|
45
|
+
let result = {
|
|
46
|
+
open Js.Array2
|
|
47
|
+
[5, 2, 3, 4, 1]->filter(isEven)->map(square)->reduce(\"+", 0)
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
*)
|
|
51
|
+
|
|
52
|
+
type 'a t = 'a array
|
|
53
|
+
(** The type used to describe a JavaScript array. *)
|
|
54
|
+
|
|
55
|
+
type 'a array_like
|
|
56
|
+
(** A type used to describe JavaScript objects that are like an array or are iterable. *)
|
|
57
|
+
|
|
58
|
+
(* commented out until bs has a plan for iterators
|
|
59
|
+
type 'a array_iter = 'a array_like
|
|
60
|
+
*)
|
|
61
|
+
|
|
62
|
+
external from : 'a array_like -> 'a array = "Array.from"
|
|
63
|
+
[@@bs.val]
|
|
64
|
+
(**
|
|
65
|
+
Creates a shallow copy of an array from an array-like object. See
|
|
66
|
+
[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)
|
|
67
|
+
on MDN.
|
|
68
|
+
|
|
69
|
+
```res example
|
|
70
|
+
let strArr = Js.String.castToArrayLike("abcd")
|
|
71
|
+
Js.Array2.from(strArr) == ["a", "b", "c", "d"]
|
|
72
|
+
```
|
|
73
|
+
*)
|
|
74
|
+
(* ES2015 *)
|
|
75
|
+
|
|
76
|
+
external fromMap : 'a array_like -> (('a -> 'b)[@bs.uncurry]) -> 'b array
|
|
77
|
+
= "Array.from"
|
|
78
|
+
[@@bs.val]
|
|
79
|
+
(**
|
|
80
|
+
Creates a new array by applying a function (the second argument) to each item
|
|
81
|
+
in the `array_like` first argument. See
|
|
82
|
+
[`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)
|
|
83
|
+
on MDN.
|
|
84
|
+
|
|
85
|
+
```res example
|
|
86
|
+
let strArr = Js.String.castToArrayLike("abcd")
|
|
87
|
+
let code = s => Js.String.charCodeAt(0, s)
|
|
88
|
+
Js.Array2.fromMap(strArr, code) == [97.0, 98.0, 99.0, 100.0]
|
|
89
|
+
```
|
|
90
|
+
*)
|
|
91
|
+
(* ES2015 *)
|
|
92
|
+
|
|
93
|
+
external isArray : 'a -> bool = "Array.isArray"
|
|
94
|
+
[@@bs.val]
|
|
95
|
+
(**
|
|
96
|
+
Returns `true` if its argument is an array; `false` otherwise. This is a runtime check, which is why the second example returns `true`---a list is internally represented as a nested JavaScript array.
|
|
97
|
+
|
|
98
|
+
```res example
|
|
99
|
+
Js.Array2.isArray([5, 2, 3, 1, 4]) == true
|
|
100
|
+
Js.Array2.isArray(list{5, 2, 3, 1, 4}) == true
|
|
101
|
+
Js.Array2.isArray("abcd") == false
|
|
102
|
+
```
|
|
103
|
+
*)
|
|
104
|
+
|
|
105
|
+
external length : 'a array -> int = "length"
|
|
106
|
+
[@@bs.get]
|
|
107
|
+
(**
|
|
108
|
+
Returns the number of elements in the array. See
|
|
109
|
+
[`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length)
|
|
110
|
+
on MDN.
|
|
111
|
+
*)
|
|
112
|
+
|
|
113
|
+
(* Mutator functions *)
|
|
114
|
+
|
|
115
|
+
external copyWithin : 'a t -> to_:int -> 'a t = "copyWithin"
|
|
116
|
+
[@@bs.send]
|
|
117
|
+
(**
|
|
118
|
+
Copies from the first element in the given array to the designated `~to_`
|
|
119
|
+
position, returning the resulting array. *This function modifies the original
|
|
120
|
+
array.* See
|
|
121
|
+
[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)
|
|
122
|
+
on MDN.
|
|
123
|
+
|
|
124
|
+
```res example
|
|
125
|
+
let arr = [100, 101, 102, 103, 104]
|
|
126
|
+
Js.Array2.copyWithin(arr, ~to_=2) == [100, 101, 100, 101, 102]
|
|
127
|
+
arr == [100, 101, 100, 101, 102]
|
|
128
|
+
```
|
|
129
|
+
*)
|
|
130
|
+
(* ES2015 *)
|
|
131
|
+
|
|
132
|
+
external copyWithinFrom : 'a t -> to_:int -> from:int -> 'a t = "copyWithin"
|
|
133
|
+
[@@bs.send]
|
|
134
|
+
(**
|
|
135
|
+
Copies starting at element `~from` in the given array to the designated `~to_`
|
|
136
|
+
position, returning the resulting array. *This function modifies the original
|
|
137
|
+
array.* See
|
|
138
|
+
[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)
|
|
139
|
+
on MDN.
|
|
140
|
+
|
|
141
|
+
```res example
|
|
142
|
+
let arr = [100, 101, 102, 103, 104]
|
|
143
|
+
Js.Array2.copyWithinFrom(arr, ~from=2, ~to_=0) == [102, 103, 104, 103, 104]
|
|
144
|
+
arr == [102, 103, 104, 103, 104]
|
|
145
|
+
```
|
|
146
|
+
*)
|
|
147
|
+
(* ES2015 *)
|
|
148
|
+
|
|
149
|
+
external copyWithinFromRange : 'a t -> to_:int -> start:int -> end_:int -> 'a t
|
|
150
|
+
= "copyWithin"
|
|
151
|
+
[@@bs.send]
|
|
152
|
+
(**
|
|
153
|
+
Copies starting at element `~start` in the given array up to but not including
|
|
154
|
+
`~end_` to the designated `~to_` position, returning the resulting array. *This
|
|
155
|
+
function modifies the original array.* See
|
|
156
|
+
[`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin)
|
|
157
|
+
on MDN.
|
|
158
|
+
|
|
159
|
+
```res example
|
|
160
|
+
let arr = [100, 101, 102, 103, 104, 105]
|
|
161
|
+
Js.Array2.copyWithinFromRange(arr, ~start=2, ~end_=5, ~to_=1) == [100, 102, 103, 104, 104, 105]
|
|
162
|
+
arr == [100, 102, 103, 104, 104, 105]
|
|
163
|
+
```
|
|
164
|
+
*)
|
|
165
|
+
(* ES2015 *)
|
|
166
|
+
|
|
167
|
+
external fillInPlace : 'a t -> 'a -> 'a t = "fill"
|
|
168
|
+
[@@bs.send]
|
|
169
|
+
(**
|
|
170
|
+
Sets all elements of the given array (the first arumgent) to the designated
|
|
171
|
+
value (the secon argument), returning the resulting array. *This function
|
|
172
|
+
modifies the original array.*
|
|
173
|
+
|
|
174
|
+
See
|
|
175
|
+
[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)
|
|
176
|
+
on MDN.
|
|
177
|
+
|
|
178
|
+
```res example
|
|
179
|
+
let arr = [100, 101, 102, 103, 104]
|
|
180
|
+
Js.Array2.fillInPlace(arr, 99) == [99, 99, 99, 99, 99]
|
|
181
|
+
arr == [99, 99, 99, 99, 99]
|
|
182
|
+
```
|
|
183
|
+
*)
|
|
184
|
+
(* ES2015 *)
|
|
185
|
+
|
|
186
|
+
external fillFromInPlace : 'a t -> 'a -> from:int -> 'a t = "fill"
|
|
187
|
+
[@@bs.send]
|
|
188
|
+
(**
|
|
189
|
+
Sets all elements of the given array (the first arumgent) from position `~from`
|
|
190
|
+
to the end to the designated value (the second argument), returning the
|
|
191
|
+
resulting array. *This function modifies the original array.* See
|
|
192
|
+
[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)
|
|
193
|
+
on MDN.
|
|
194
|
+
|
|
195
|
+
```res example
|
|
196
|
+
let arr = [100, 101, 102, 103, 104]
|
|
197
|
+
Js.Array2.fillFromInPlace(arr, 99, ~from=2) == [100, 101, 99, 99, 99]
|
|
198
|
+
arr == [100, 101, 99, 99, 99]
|
|
199
|
+
```
|
|
200
|
+
*)
|
|
201
|
+
(* ES2015 *)
|
|
202
|
+
|
|
203
|
+
external fillRangeInPlace : 'a t -> 'a -> start:int -> end_:int -> 'a t = "fill"
|
|
204
|
+
[@@bs.send]
|
|
205
|
+
(**
|
|
206
|
+
Sets the elements of the given array (the first arumgent) from position
|
|
207
|
+
`~start` up to but not including position `~end_` to the designated value (the
|
|
208
|
+
second argument), returning the resulting array. *This function modifies the
|
|
209
|
+
original array.* See
|
|
210
|
+
[`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill)
|
|
211
|
+
on MDN.
|
|
212
|
+
|
|
213
|
+
```res example
|
|
214
|
+
let arr = [100, 101, 102, 103, 104]
|
|
215
|
+
Js.Array2.fillRangeInPlace(arr, 99, ~start=1, ~end_=4) == [100, 99, 99, 99, 104]
|
|
216
|
+
arr == [100, 99, 99, 99, 104]
|
|
217
|
+
```
|
|
218
|
+
*)
|
|
219
|
+
(* ES2015 *)
|
|
220
|
+
|
|
221
|
+
external pop : 'a t -> 'a option = "pop"
|
|
222
|
+
[@@bs.send] [@@bs.return undefined_to_opt]
|
|
223
|
+
(**
|
|
224
|
+
If the array is not empty, removes the last element and returns it as
|
|
225
|
+
`Some(value)`; returns `None` if the array is empty. *This function modifies
|
|
226
|
+
the original array.* See
|
|
227
|
+
[`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop)
|
|
228
|
+
on MDN.
|
|
229
|
+
|
|
230
|
+
```res example
|
|
231
|
+
let arr = [100, 101, 102, 103, 104]
|
|
232
|
+
Js.Array2.pop(arr) == Some(104)
|
|
233
|
+
arr == [100, 101, 102, 103]
|
|
234
|
+
|
|
235
|
+
let empty: array<int> = []
|
|
236
|
+
Js.Array2.pop(empty) == None
|
|
237
|
+
```
|
|
238
|
+
*)
|
|
239
|
+
|
|
240
|
+
external push : 'a t -> 'a -> int = "push"
|
|
241
|
+
[@@bs.send]
|
|
242
|
+
(**
|
|
243
|
+
Appends the given value to the array, returning the number of elements in the
|
|
244
|
+
updated array. *This function modifies the original array.* See
|
|
245
|
+
[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)
|
|
246
|
+
on MDN.
|
|
247
|
+
|
|
248
|
+
```res example
|
|
249
|
+
let arr = ["ant", "bee", "cat"]
|
|
250
|
+
Js.Array2.push(arr, "dog") == 4
|
|
251
|
+
arr == ["ant", "bee", "cat", "dog"]
|
|
252
|
+
```
|
|
253
|
+
*)
|
|
254
|
+
|
|
255
|
+
external pushMany : 'a t -> 'a array -> int = "push"
|
|
256
|
+
[@@bs.send] [@@bs.splice]
|
|
257
|
+
(**
|
|
258
|
+
Appends the values from one array (the second argument) to another (the first
|
|
259
|
+
argument), returning the number of elements in the updated array. *This
|
|
260
|
+
function modifies the original array.* See
|
|
261
|
+
[`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push)
|
|
262
|
+
on MDN.
|
|
263
|
+
|
|
264
|
+
```res example
|
|
265
|
+
let arr = ["ant", "bee", "cat"]
|
|
266
|
+
Js.Array2.pushMany(arr, ["dog", "elk"]) == 5
|
|
267
|
+
arr == ["ant", "bee", "cat", "dog", "elk"]
|
|
268
|
+
```
|
|
269
|
+
*)
|
|
270
|
+
|
|
271
|
+
external reverseInPlace : 'a t -> 'a t = "reverse"
|
|
272
|
+
[@@bs.send]
|
|
273
|
+
(**
|
|
274
|
+
Returns an array with the elements of the input array in reverse order. *This
|
|
275
|
+
function modifies the original array.* See
|
|
276
|
+
[`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)
|
|
277
|
+
on MDN.
|
|
278
|
+
|
|
279
|
+
```res example
|
|
280
|
+
let arr = ["ant", "bee", "cat"]
|
|
281
|
+
Js.Array2.reverseInPlace(arr) == ["cat", "bee", "ant"]
|
|
282
|
+
arr == ["cat", "bee", "ant"]
|
|
283
|
+
```
|
|
284
|
+
*)
|
|
285
|
+
|
|
286
|
+
external shift : 'a t -> 'a option = "shift"
|
|
287
|
+
[@@bs.send] [@@bs.return undefined_to_opt]
|
|
288
|
+
(**
|
|
289
|
+
If the array is not empty, removes the first element and returns it as
|
|
290
|
+
`Some(value)`; returns `None` if the array is empty. *This function modifies
|
|
291
|
+
the original array.* See
|
|
292
|
+
[`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)
|
|
293
|
+
on MDN.
|
|
294
|
+
|
|
295
|
+
```res example
|
|
296
|
+
let arr = [100, 101, 102, 103, 104]
|
|
297
|
+
Js.Array2.shift(arr) == Some(100)
|
|
298
|
+
arr == [101, 102, 103, 104]
|
|
299
|
+
|
|
300
|
+
let empty: array<int> = []
|
|
301
|
+
Js.Array2.shift(empty) == None
|
|
302
|
+
```
|
|
303
|
+
*)
|
|
304
|
+
|
|
305
|
+
external sortInPlace : 'a t -> 'a t = "sort"
|
|
306
|
+
[@@bs.send]
|
|
307
|
+
(**
|
|
308
|
+
Sorts the given array in place and returns the sorted array. JavaScript sorts
|
|
309
|
+
the array by converting the arguments to UTF-16 strings and sorting them. See
|
|
310
|
+
the second example with sorting numbers, which does not do a numeric sort.
|
|
311
|
+
*This function modifies the original array.* See
|
|
312
|
+
[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)
|
|
313
|
+
on MDN.
|
|
314
|
+
|
|
315
|
+
```res example
|
|
316
|
+
let words = ["bee", "dog", "ant", "cat"]
|
|
317
|
+
Js.Array2.sortInPlace(words) == ["ant", "bee", "cat", "dog"]
|
|
318
|
+
words == ["ant", "bee", "cat", "dog"]
|
|
319
|
+
|
|
320
|
+
let numbers = [3, 30, 10, 1, 20, 2]
|
|
321
|
+
Js.Array2.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]
|
|
322
|
+
numbers == [1, 10, 2, 20, 3, 30]
|
|
323
|
+
```
|
|
324
|
+
*)
|
|
325
|
+
|
|
326
|
+
external sortInPlaceWith : 'a t -> (('a -> 'a -> int)[@bs.uncurry]) -> 'a t
|
|
327
|
+
= "sort"
|
|
328
|
+
[@@bs.send]
|
|
329
|
+
(**
|
|
330
|
+
Sorts the given array in place and returns the sorted array. *This function
|
|
331
|
+
modifies the original array.*
|
|
332
|
+
|
|
333
|
+
The first argument to `sortInPlaceWith()` is a function that compares two items
|
|
334
|
+
from the array and returns:
|
|
335
|
+
|
|
336
|
+
* an integer less than zero if the first item is less than the second item *
|
|
337
|
+
zero if the items are equal * an integer greater than zero if the first item is
|
|
338
|
+
greater than the second item
|
|
339
|
+
|
|
340
|
+
See
|
|
341
|
+
[`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)
|
|
342
|
+
on MDN.
|
|
343
|
+
|
|
344
|
+
```res example
|
|
345
|
+
// sort by word length
|
|
346
|
+
let words = ["horse", "aardvark", "dog", "camel"]
|
|
347
|
+
let byLength = (s1, s2) => Js.String.length(s1) - Js.String.length(s2)
|
|
348
|
+
|
|
349
|
+
Js.Array2.sortInPlaceWith(words, byLength) == ["dog", "horse", "camel", "aardvark"]
|
|
350
|
+
|
|
351
|
+
// sort in reverse numeric order
|
|
352
|
+
let numbers = [3, 30, 10, 1, 20, 2]
|
|
353
|
+
let reverseNumeric = (n1, n2) => n2 - n1
|
|
354
|
+
Js.Array2.sortInPlaceWith(numbers, reverseNumeric) == [30, 20, 10, 3, 2, 1]
|
|
355
|
+
```
|
|
356
|
+
*)
|
|
357
|
+
|
|
358
|
+
external spliceInPlace : 'a t -> pos:int -> remove:int -> add:'a array -> 'a t
|
|
359
|
+
= "splice"
|
|
360
|
+
[@@bs.send] [@@bs.splice]
|
|
361
|
+
(**
|
|
362
|
+
Starting at position `~pos`, remove `~remove` elements and then add the
|
|
363
|
+
elements from the `~add` array. Returns an array consisting of the removed
|
|
364
|
+
items. *This function modifies the original array.* See
|
|
365
|
+
[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)
|
|
366
|
+
on MDN.
|
|
367
|
+
|
|
368
|
+
```res example
|
|
369
|
+
let arr = ["a", "b", "c", "d", "e", "f"]
|
|
370
|
+
Js.Array2.spliceInPlace(arr, ~pos=2, ~remove=2, ~add=["x", "y", "z"]) == ["c", "d"]
|
|
371
|
+
arr == ["a", "b", "x", "y", "z", "e", "f"]
|
|
372
|
+
|
|
373
|
+
let arr2 = ["a", "b", "c", "d"]
|
|
374
|
+
Js.Array2.spliceInPlace(arr2, ~pos=3, ~remove=0, ~add=["x", "y"]) == []
|
|
375
|
+
arr2 == ["a", "b", "c", "x", "y", "d"]
|
|
376
|
+
|
|
377
|
+
let arr3 = ["a", "b", "c", "d", "e", "f"]
|
|
378
|
+
Js.Array2.spliceInPlace(arr3, ~pos=9, ~remove=2, ~add=["x", "y", "z"]) == []
|
|
379
|
+
arr3 == ["a", "b", "c", "d", "e", "f", "x", "y", "z"]
|
|
380
|
+
```
|
|
381
|
+
*)
|
|
382
|
+
|
|
383
|
+
external removeFromInPlace : 'a t -> pos:int -> 'a t = "splice"
|
|
384
|
+
[@@bs.send]
|
|
385
|
+
(**
|
|
386
|
+
Removes elements from the given array starting at position `~pos` to the end of
|
|
387
|
+
the array, returning the removed elements. *This function modifies the original
|
|
388
|
+
array.* See
|
|
389
|
+
[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)
|
|
390
|
+
on MDN.
|
|
391
|
+
|
|
392
|
+
```res example
|
|
393
|
+
let arr = ["a", "b", "c", "d", "e", "f"]
|
|
394
|
+
Js.Array2.removeFromInPlace(arr, ~pos=4) == ["e", "f"]
|
|
395
|
+
arr == ["a", "b", "c", "d"]
|
|
396
|
+
```
|
|
397
|
+
*)
|
|
398
|
+
|
|
399
|
+
external removeCountInPlace : 'a t -> pos:int -> count:int -> 'a t = "splice"
|
|
400
|
+
[@@bs.send]
|
|
401
|
+
(**
|
|
402
|
+
Removes `~count` elements from the given array starting at position `~pos`,
|
|
403
|
+
returning the removed elements. *This function modifies the original array.*
|
|
404
|
+
See
|
|
405
|
+
[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)
|
|
406
|
+
on MDN.
|
|
407
|
+
|
|
408
|
+
```res example
|
|
409
|
+
let arr = ["a", "b", "c", "d", "e", "f"]
|
|
410
|
+
Js.Array2.removeCountInPlace(arr, ~pos=2, ~count=3) == ["c", "d", "e"]
|
|
411
|
+
arr == ["a", "b", "f"]
|
|
412
|
+
```
|
|
413
|
+
*)
|
|
414
|
+
|
|
415
|
+
external unshift : 'a t -> 'a -> int = "unshift"
|
|
416
|
+
[@@bs.send]
|
|
417
|
+
(**
|
|
418
|
+
Adds the given element to the array, returning the new number of elements in
|
|
419
|
+
the array. *This function modifies the original array.* See
|
|
420
|
+
[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)
|
|
421
|
+
on MDN.
|
|
422
|
+
|
|
423
|
+
```res example
|
|
424
|
+
let arr = ["b", "c", "d"]
|
|
425
|
+
Js.Array2.unshift(arr, "a") == 4
|
|
426
|
+
arr == ["a", "b", "c", "d"]
|
|
427
|
+
```
|
|
428
|
+
*)
|
|
429
|
+
|
|
430
|
+
external unshiftMany : 'a t -> 'a array -> int = "unshift"
|
|
431
|
+
[@@bs.send] [@@bs.splice]
|
|
432
|
+
(**
|
|
433
|
+
Adds the elements in the second array argument at the beginning of the first
|
|
434
|
+
array argument, returning the new number of elements in the array. *This
|
|
435
|
+
function modifies the original array.* See
|
|
436
|
+
[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)
|
|
437
|
+
on MDN.
|
|
438
|
+
|
|
439
|
+
```res example
|
|
440
|
+
let arr = ["d", "e"]
|
|
441
|
+
Js.Array2.unshiftMany(arr, ["a", "b", "c"]) == 5
|
|
442
|
+
arr == ["a", "b", "c", "d", "e"]
|
|
443
|
+
```
|
|
444
|
+
*)
|
|
445
|
+
|
|
446
|
+
(* Accessor functions
|
|
447
|
+
*)
|
|
448
|
+
external append : 'a t -> 'a -> 'a t = "concat"
|
|
449
|
+
[@@bs.send] [@@deprecated "`append` is not type-safe. Use `concat` instead."]
|
|
450
|
+
|
|
451
|
+
external concat : 'a t -> 'a t -> 'a t = "concat"
|
|
452
|
+
[@@bs.send]
|
|
453
|
+
(**
|
|
454
|
+
Concatenates the second array argument to the first array argument, returning a
|
|
455
|
+
new array. The original arrays are not modified. See
|
|
456
|
+
[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)
|
|
457
|
+
on MDN.
|
|
458
|
+
|
|
459
|
+
```res example
|
|
460
|
+
Js.Array2.concat(["a", "b"], ["c", "d", "e"]) == ["a", "b", "c", "d", "e"]
|
|
461
|
+
```
|
|
462
|
+
*)
|
|
463
|
+
|
|
464
|
+
external concatMany : 'a t -> 'a t array -> 'a t = "concat"
|
|
465
|
+
[@@bs.send] [@@bs.splice]
|
|
466
|
+
(**
|
|
467
|
+
The second argument to `concatMany()` is an array of arrays; these are added at
|
|
468
|
+
the end of the first argument, returning a new array. See
|
|
469
|
+
[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)
|
|
470
|
+
on MDN.
|
|
471
|
+
|
|
472
|
+
```res example
|
|
473
|
+
Js.Array2.concatMany(["a", "b", "c"], [["d", "e"], ["f", "g", "h"]]) == [
|
|
474
|
+
"a",
|
|
475
|
+
"b",
|
|
476
|
+
"c",
|
|
477
|
+
"d",
|
|
478
|
+
"e",
|
|
479
|
+
"f",
|
|
480
|
+
"g",
|
|
481
|
+
"h",
|
|
482
|
+
]
|
|
483
|
+
```
|
|
484
|
+
*)
|
|
485
|
+
|
|
486
|
+
external includes : 'a t -> 'a -> bool = "includes"
|
|
487
|
+
[@@bs.send]
|
|
488
|
+
(**
|
|
489
|
+
Returns true if the given value is in the array, `false` otherwise. See
|
|
490
|
+
[`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)
|
|
491
|
+
on MDN.
|
|
492
|
+
|
|
493
|
+
```res example
|
|
494
|
+
Js.Array2.includes(["a", "b", "c"], "b") == true
|
|
495
|
+
Js.Array2.includes(["a", "b", "c"], "x") == false
|
|
496
|
+
```
|
|
497
|
+
*)
|
|
498
|
+
|
|
499
|
+
external indexOf : 'a t -> 'a -> int = "indexOf"
|
|
500
|
+
[@@bs.send]
|
|
501
|
+
(**
|
|
502
|
+
Returns the index of the first element in the array that has the given value.
|
|
503
|
+
If the value is not in the array, returns -1. See
|
|
504
|
+
[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)
|
|
505
|
+
on MDN.
|
|
506
|
+
|
|
507
|
+
```res example
|
|
508
|
+
Js.Array2.indexOf([100, 101, 102, 103], 102) == 2
|
|
509
|
+
Js.Array2.indexOf([100, 101, 102, 103], 999) == -1
|
|
510
|
+
```
|
|
511
|
+
*)
|
|
512
|
+
|
|
513
|
+
external indexOfFrom : 'a t -> 'a -> from:int -> int = "indexOf"
|
|
514
|
+
[@@bs.send]
|
|
515
|
+
(**
|
|
516
|
+
Returns the index of the first element in the array with the given value. The
|
|
517
|
+
search starts at position `~from`. See
|
|
518
|
+
[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)
|
|
519
|
+
on MDN.
|
|
520
|
+
|
|
521
|
+
```res example
|
|
522
|
+
Js.Array2.indexOfFrom(["a", "b", "a", "c", "a"], "a", ~from=2) == 2
|
|
523
|
+
Js.Array2.indexOfFrom(["a", "b", "a", "c", "a"], "a", ~from=3) == 4
|
|
524
|
+
Js.Array2.indexOfFrom(["a", "b", "a", "c", "a"], "b", ~from=2) == -1
|
|
525
|
+
```
|
|
526
|
+
*)
|
|
527
|
+
|
|
528
|
+
external joinWith : 'a t -> string -> string = "join"
|
|
529
|
+
[@@bs.send]
|
|
530
|
+
(**
|
|
531
|
+
This function converts each element of the array to a string (via JavaScript)
|
|
532
|
+
and concatenates them, separated by the string given in the first argument,
|
|
533
|
+
into a single string. See
|
|
534
|
+
[`Array.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)
|
|
535
|
+
on MDN.
|
|
536
|
+
|
|
537
|
+
```res example
|
|
538
|
+
Js.Array2.joinWith(["ant", "bee", "cat"], "--") == "ant--bee--cat"
|
|
539
|
+
Js.Array2.joinWith(["door", "bell"], "") == "doorbell"
|
|
540
|
+
Js.Array2.joinWith([2020, 9, 4], "/") == "2020/9/4"
|
|
541
|
+
Js.Array2.joinWith([2.5, 3.6, 3e-2], ";") == "2.5;3.6;0.03"
|
|
542
|
+
```
|
|
543
|
+
*)
|
|
544
|
+
|
|
545
|
+
external lastIndexOf : 'a t -> 'a -> int = "lastIndexOf"
|
|
546
|
+
[@@bs.send]
|
|
547
|
+
(**
|
|
548
|
+
Returns the index of the last element in the array that has the given value. If
|
|
549
|
+
the value is not in the array, returns -1. See
|
|
550
|
+
[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)
|
|
551
|
+
on MDN.
|
|
552
|
+
|
|
553
|
+
```res example
|
|
554
|
+
Js.Array2.lastIndexOf(["a", "b", "a", "c"], "a") == 2
|
|
555
|
+
Js.Array2.lastIndexOf(["a", "b", "a", "c"], "x") == -1
|
|
556
|
+
```
|
|
557
|
+
*)
|
|
558
|
+
|
|
559
|
+
external lastIndexOfFrom : 'a t -> 'a -> from:int -> int = "lastIndexOf"
|
|
560
|
+
[@@bs.send]
|
|
561
|
+
(**
|
|
562
|
+
Returns the index of the last element in the array that has the given value,
|
|
563
|
+
searching from position `~from` down to the start of the array. If the value is
|
|
564
|
+
not in the array, returns -1. See
|
|
565
|
+
[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)
|
|
566
|
+
on MDN.
|
|
567
|
+
|
|
568
|
+
```res example
|
|
569
|
+
Js.Array2.lastIndexOfFrom(["a", "b", "a", "c", "a", "d"], "a", ~from=3) == 2
|
|
570
|
+
Js.Array2.lastIndexOfFrom(["a", "b", "a", "c", "a", "d"], "c", ~from=2) == -1
|
|
571
|
+
```
|
|
572
|
+
*)
|
|
573
|
+
|
|
574
|
+
external slice : 'a t -> start:int -> end_:int -> 'a t = "slice"
|
|
575
|
+
[@@bs.send]
|
|
576
|
+
(**
|
|
577
|
+
Returns a shallow copy of the given array from the `~start` index up to but not
|
|
578
|
+
including the `~end_` position. Negative numbers indicate an offset from the
|
|
579
|
+
end of the array. See
|
|
580
|
+
[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)
|
|
581
|
+
on MDN.
|
|
582
|
+
|
|
583
|
+
```res example
|
|
584
|
+
let arr = [100, 101, 102, 103, 104, 105, 106]
|
|
585
|
+
Js.Array2.slice(arr, ~start=2, ~end_=5) == [102, 103, 104]
|
|
586
|
+
Js.Array2.slice(arr, ~start=-3, ~end_=-1) == [104, 105]
|
|
587
|
+
Js.Array2.slice(arr, ~start=9, ~end_=10) == []
|
|
588
|
+
```
|
|
589
|
+
*)
|
|
590
|
+
|
|
591
|
+
external copy : 'a t -> 'a t = "slice"
|
|
592
|
+
[@@bs.send]
|
|
593
|
+
(**
|
|
594
|
+
Returns a copy of the entire array. Same as `Js.Array2.Slice(arr, ~start=0,
|
|
595
|
+
~end_=Js.Array2.length(arr))`. See
|
|
596
|
+
[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)
|
|
597
|
+
on MDN.
|
|
598
|
+
*)
|
|
599
|
+
|
|
600
|
+
external sliceFrom : 'a t -> int -> 'a t = "slice"
|
|
601
|
+
[@@bs.send]
|
|
602
|
+
(**
|
|
603
|
+
Returns a shallow copy of the given array from the given index to the end. See
|
|
604
|
+
[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)
|
|
605
|
+
on MDN.
|
|
606
|
+
*)
|
|
607
|
+
|
|
608
|
+
external toString : 'a t -> string = "toString"
|
|
609
|
+
[@@bs.send]
|
|
610
|
+
(**
|
|
611
|
+
Converts the array to a string. Each element is converted to a string using
|
|
612
|
+
JavaScript. Unlike the JavaScript `Array.toString()`, all elements in a
|
|
613
|
+
ReasonML array must have the same type. See
|
|
614
|
+
[`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString)
|
|
615
|
+
on MDN.
|
|
616
|
+
|
|
617
|
+
```res example
|
|
618
|
+
Js.Array2.toString([3.5, 4.6, 7.8]) == "3.5,4.6,7.8"
|
|
619
|
+
Js.Array2.toString(["a", "b", "c"]) == "a,b,c"
|
|
620
|
+
```
|
|
621
|
+
*)
|
|
622
|
+
|
|
623
|
+
external toLocaleString : 'a t -> string = "toLocaleString"
|
|
624
|
+
[@@bs.send]
|
|
625
|
+
(**
|
|
626
|
+
Converts the array to a string using the conventions of the current locale.
|
|
627
|
+
Each element is converted to a string using JavaScript. Unlike the JavaScript
|
|
628
|
+
`Array.toLocaleString()`, all elements in a ReasonML array must have the same
|
|
629
|
+
type. See
|
|
630
|
+
[`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString)
|
|
631
|
+
on MDN.
|
|
632
|
+
|
|
633
|
+
```res example
|
|
634
|
+
Js.Array2.toLocaleString([Js.Date.make()])
|
|
635
|
+
// returns "3/19/2020, 10:52:11 AM" for locale en_US.utf8
|
|
636
|
+
// returns "2020-3-19 10:52:11" for locale de_DE.utf8
|
|
637
|
+
```
|
|
638
|
+
*)
|
|
639
|
+
|
|
640
|
+
(* Iteration functions
|
|
641
|
+
*)
|
|
642
|
+
(* commented out until bs has a plan for iterators
|
|
643
|
+
external entries : 'a t -> (int * 'a) array_iter = "" [@@bs.send] (* ES2015 *)
|
|
644
|
+
*)
|
|
645
|
+
|
|
646
|
+
external every : 'a t -> (('a -> bool)[@bs.uncurry]) -> bool = "every"
|
|
647
|
+
[@@bs.send]
|
|
648
|
+
(**
|
|
649
|
+
The first argument to `every()` is an array. The second argument is a predicate
|
|
650
|
+
function that returns a boolean. The `every()` function returns `true` if the
|
|
651
|
+
predicate function is true for all items in the given array. If given an empty
|
|
652
|
+
array, returns `true`. See
|
|
653
|
+
[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)
|
|
654
|
+
on MDN.
|
|
655
|
+
|
|
656
|
+
```res example
|
|
657
|
+
let isEven = x => mod(x, 2) == 0
|
|
658
|
+
Js.Array2.every([6, 22, 8, 4], isEven) == true
|
|
659
|
+
Js.Array2.every([6, 22, 7, 4], isEven) == false
|
|
660
|
+
```
|
|
661
|
+
*)
|
|
662
|
+
|
|
663
|
+
external everyi : 'a t -> (('a -> int -> bool)[@bs.uncurry]) -> bool = "every"
|
|
664
|
+
[@@bs.send]
|
|
665
|
+
(**
|
|
666
|
+
The first argument to `everyi()` is an array. The second argument is a
|
|
667
|
+
predicate function with two arguments: an array element and that element’s
|
|
668
|
+
index; it returns a boolean. The `everyi()` function returns `true` if the
|
|
669
|
+
predicate function is true for all items in the given array. If given an empty
|
|
670
|
+
array, returns `true`. See
|
|
671
|
+
[`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every)
|
|
672
|
+
on MDN.
|
|
673
|
+
|
|
674
|
+
```res example
|
|
675
|
+
// determine if all even-index items are positive
|
|
676
|
+
let evenIndexPositive = (item, index) => mod(index, 2) == 0 ? item > 0 : true
|
|
677
|
+
|
|
678
|
+
Js.Array2.everyi([6, -3, 5, 8], evenIndexPositive) == true
|
|
679
|
+
Js.Array2.everyi([6, 3, -5, 8], evenIndexPositive) == false
|
|
680
|
+
```
|
|
681
|
+
*)
|
|
682
|
+
|
|
683
|
+
external filter : 'a t -> (('a -> bool)[@bs.uncurry]) -> 'a t = "filter"
|
|
684
|
+
[@@bs.send]
|
|
685
|
+
(**
|
|
686
|
+
Applies the given predicate function (the second argument) to each element in
|
|
687
|
+
the array; the result is an array of those elements for which the predicate
|
|
688
|
+
function returned `true`. See
|
|
689
|
+
[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
|
|
690
|
+
on MDN.
|
|
691
|
+
|
|
692
|
+
```res example
|
|
693
|
+
let nonEmpty = s => s != ""
|
|
694
|
+
Js.Array2.filter(["abc", "", "", "def", "ghi"], nonEmpty) == ["abc", "def", "ghi"]
|
|
695
|
+
```
|
|
696
|
+
*)
|
|
697
|
+
|
|
698
|
+
external filteri : 'a t -> (('a -> int -> bool)[@bs.uncurry]) -> 'a t = "filter"
|
|
699
|
+
[@@bs.send]
|
|
700
|
+
(**
|
|
701
|
+
Each element of the given array are passed to the predicate function. The
|
|
702
|
+
return value is an array of all those elements for which the predicate function
|
|
703
|
+
returned `true`.
|
|
704
|
+
|
|
705
|
+
See
|
|
706
|
+
[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
|
|
707
|
+
on MDN.
|
|
708
|
+
|
|
709
|
+
```res example
|
|
710
|
+
// keep only positive elements at odd indices
|
|
711
|
+
let positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0
|
|
712
|
+
|
|
713
|
+
Js.Array2.filteri([6, 3, 5, 8, 7, -4, 1], positiveOddElement) == [3, 8]
|
|
714
|
+
```
|
|
715
|
+
*)
|
|
716
|
+
|
|
717
|
+
external find : 'a t -> (('a -> bool)[@bs.uncurry]) -> 'a option = "find"
|
|
718
|
+
[@@bs.send] [@@bs.return { undefined_to_opt }]
|
|
719
|
+
(**
|
|
720
|
+
Returns `Some(value)` for the first element in the array that satisifies the
|
|
721
|
+
given predicate function, or `None` if no element satisifies the predicate. See
|
|
722
|
+
[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
|
|
723
|
+
on MDN.
|
|
724
|
+
|
|
725
|
+
```res example
|
|
726
|
+
// find first negative element
|
|
727
|
+
Js.Array2.find([33, 22, -55, 77, -44], x => x < 0) == Some(-55)
|
|
728
|
+
Js.Array2.find([33, 22, 55, 77, 44], x => x < 0) == None
|
|
729
|
+
```
|
|
730
|
+
*)
|
|
731
|
+
(* ES2015 *)
|
|
732
|
+
|
|
733
|
+
external findi : 'a t -> (('a -> int -> bool)[@bs.uncurry]) -> 'a option
|
|
734
|
+
= "find"
|
|
735
|
+
[@@bs.send] [@@bs.return { undefined_to_opt }]
|
|
736
|
+
(**
|
|
737
|
+
Returns `Some(value)` for the first element in the array that satisifies the
|
|
738
|
+
given predicate function, or `None` if no element satisifies the predicate. The
|
|
739
|
+
predicate function takes an array element and an index as its parameters. See
|
|
740
|
+
[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
|
|
741
|
+
on MDN.
|
|
742
|
+
|
|
743
|
+
```res example
|
|
744
|
+
// find first positive item at an odd index
|
|
745
|
+
let positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0
|
|
746
|
+
|
|
747
|
+
Js.Array2.findi([66, -33, 55, 88, 22], positiveOddElement) == Some(88)
|
|
748
|
+
Js.Array2.findi([66, -33, 55, -88, 22], positiveOddElement) == None
|
|
749
|
+
```
|
|
750
|
+
*)
|
|
751
|
+
(* ES2015 *)
|
|
752
|
+
|
|
753
|
+
external findIndex : 'a t -> (('a -> bool)[@bs.uncurry]) -> int = "findIndex"
|
|
754
|
+
[@@bs.send]
|
|
755
|
+
(**
|
|
756
|
+
Returns the index of the first element in the array that satisifies the given
|
|
757
|
+
predicate function, or -1 if no element satisifies the predicate. See
|
|
758
|
+
[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
|
|
759
|
+
on MDN.
|
|
760
|
+
|
|
761
|
+
```res example
|
|
762
|
+
Js.Array2.findIndex([33, 22, -55, 77, -44], x => x < 0) == 2
|
|
763
|
+
Js.Array2.findIndex([33, 22, 55, 77, 44], x => x < 0) == -1
|
|
764
|
+
```
|
|
765
|
+
*)
|
|
766
|
+
(* ES2015 *)
|
|
767
|
+
|
|
768
|
+
external findIndexi : 'a t -> (('a -> int -> bool)[@bs.uncurry]) -> int
|
|
769
|
+
= "findIndex"
|
|
770
|
+
[@@bs.send]
|
|
771
|
+
(**
|
|
772
|
+
Returns `Some(value)` for the first element in the array that satisifies the
|
|
773
|
+
given predicate function, or `None` if no element satisifies the predicate. The
|
|
774
|
+
predicate function takes an array element and an index as its parameters. See
|
|
775
|
+
[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
|
|
776
|
+
on MDN.
|
|
777
|
+
|
|
778
|
+
```res example
|
|
779
|
+
// find index of first positive item at an odd index
|
|
780
|
+
let positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0
|
|
781
|
+
|
|
782
|
+
Js.Array2.findIndexi([66, -33, 55, 88, 22], positiveOddElement) == 3
|
|
783
|
+
Js.Array2.findIndexi([66, -33, 55, -88, 22], positiveOddElement) == -1
|
|
784
|
+
```
|
|
785
|
+
*)
|
|
786
|
+
(* ES2015 *)
|
|
787
|
+
|
|
788
|
+
external forEach : 'a t -> (('a -> unit)[@bs.uncurry]) -> unit = "forEach"
|
|
789
|
+
[@@bs.send]
|
|
790
|
+
(**
|
|
791
|
+
The `forEach()` function applies the function given as the second argument to
|
|
792
|
+
each element in the array. The function you provide returns `unit`, and the
|
|
793
|
+
`forEach()` function also returns `unit`. You use `forEach()` when you need to
|
|
794
|
+
process each element in the array but not return any new array or value; for
|
|
795
|
+
example, to print the items in an array. See
|
|
796
|
+
[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
|
|
797
|
+
on MDN.
|
|
798
|
+
|
|
799
|
+
```res example
|
|
800
|
+
// display all elements in an array
|
|
801
|
+
Js.Array2.forEach(["a", "b", "c"], x => Js.log(x)) == ()
|
|
802
|
+
```
|
|
803
|
+
*)
|
|
804
|
+
|
|
805
|
+
external forEachi : 'a t -> (('a -> int -> unit)[@bs.uncurry]) -> unit
|
|
806
|
+
= "forEach"
|
|
807
|
+
[@@bs.send]
|
|
808
|
+
(**
|
|
809
|
+
The `forEachi()` function applies the function given as the second argument to
|
|
810
|
+
each element in the array. The function you provide takes an item in the array
|
|
811
|
+
and its index number, and returns `unit`. The `forEachi()` function also
|
|
812
|
+
returns `unit`. You use `forEachi()` when you need to process each element in
|
|
813
|
+
the array but not return any new array or value; for example, to print the
|
|
814
|
+
items in an array. See
|
|
815
|
+
[`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
|
|
816
|
+
on MDN.
|
|
817
|
+
|
|
818
|
+
```res example
|
|
819
|
+
// display all elements in an array as a numbered list
|
|
820
|
+
Js.Array2.forEachi(["a", "b", "c"], (item, index) => Js.log2(index + 1, item)) == ()
|
|
821
|
+
```
|
|
822
|
+
*)
|
|
823
|
+
|
|
824
|
+
(* commented out until bs has a plan for iterators
|
|
825
|
+
external keys : 'a t -> int array_iter = "" [@@bs.send] (* ES2015 *)
|
|
826
|
+
*)
|
|
827
|
+
|
|
828
|
+
external map : 'a t -> (('a -> 'b)[@bs.uncurry]) -> 'b t = "map"
|
|
829
|
+
[@@bs.send]
|
|
830
|
+
(**
|
|
831
|
+
Applies the function (the second argument) to each item in the array, returning
|
|
832
|
+
a new array. The result array does not have to have elements of the same type
|
|
833
|
+
as the input array. See
|
|
834
|
+
[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
|
|
835
|
+
on MDN.
|
|
836
|
+
|
|
837
|
+
```res example
|
|
838
|
+
Js.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]
|
|
839
|
+
Js.Array2.map(["animal", "vegetable", "mineral"], Js.String.length) == [6, 9, 7]
|
|
840
|
+
```
|
|
841
|
+
*)
|
|
842
|
+
|
|
843
|
+
external mapi : 'a t -> (('a -> int -> 'b)[@bs.uncurry]) -> 'b t = "map"
|
|
844
|
+
[@@bs.send]
|
|
845
|
+
(**
|
|
846
|
+
Applies the function (the second argument) to each item in the array, returning
|
|
847
|
+
a new array. The function acceps two arguments: an item from the array and its
|
|
848
|
+
index number. The result array does not have to have elements of the same type
|
|
849
|
+
as the input array. See
|
|
850
|
+
[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
|
|
851
|
+
on MDN.
|
|
852
|
+
|
|
853
|
+
```res example
|
|
854
|
+
// multiply each item in array by its position
|
|
855
|
+
let product = (item, index) => item * index
|
|
856
|
+
Js.Array2.mapi([10, 11, 12], product) == [0, 11, 24]
|
|
857
|
+
```
|
|
858
|
+
*)
|
|
859
|
+
|
|
860
|
+
external reduce : 'a t -> (('b -> 'a -> 'b)[@bs.uncurry]) -> 'b -> 'b = "reduce"
|
|
861
|
+
[@@bs.send]
|
|
862
|
+
(**
|
|
863
|
+
The `reduce()` function takes three parameters: an array, a *reducer function*,
|
|
864
|
+
and a beginning accumulator value. The reducer function has two parameters: an
|
|
865
|
+
accumulated value and an element of the array.
|
|
866
|
+
|
|
867
|
+
`reduce()` first calls the reducer function with the beginning value and the
|
|
868
|
+
first element in the array. The result becomes the new accumulator value, which
|
|
869
|
+
is passed in to the reducer function along with the second element in the
|
|
870
|
+
array. `reduce()` proceeds through the array, passing in the result of each
|
|
871
|
+
stage as the accumulator to the reducer function.
|
|
872
|
+
|
|
873
|
+
When all array elements are processed, the final value of the accumulator
|
|
874
|
+
becomes the return value of `reduce()`. See
|
|
875
|
+
[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
|
|
876
|
+
on MDN.
|
|
877
|
+
|
|
878
|
+
```res example
|
|
879
|
+
let sumOfSquares = (accumulator, item) => accumulator + item * item
|
|
880
|
+
|
|
881
|
+
Js.Array2.reduce([10, 2, 4], sumOfSquares, 0) == 120
|
|
882
|
+
Js.Array2.reduce([10, 2, 4], \"*", 1) == 80
|
|
883
|
+
Js.Array2.reduce(
|
|
884
|
+
["animal", "vegetable", "mineral"],
|
|
885
|
+
(acc, item) => acc + Js.String.length(item),
|
|
886
|
+
0,
|
|
887
|
+
) == 22 // 6 + 9 + 7
|
|
888
|
+
Js.Array2.reduce([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 2.0 // 4.0 / (2.0 / 1.0)
|
|
889
|
+
```
|
|
890
|
+
*)
|
|
891
|
+
|
|
892
|
+
external reducei : 'a t -> (('b -> 'a -> int -> 'b)[@bs.uncurry]) -> 'b -> 'b
|
|
893
|
+
= "reduce"
|
|
894
|
+
[@@bs.send]
|
|
895
|
+
(**
|
|
896
|
+
The `reducei()` function takes three parameters: an array, a *reducer
|
|
897
|
+
function*, and a beginning accumulator value. The reducer function has three
|
|
898
|
+
parameters: an accumulated value, an element of the array, and the index of
|
|
899
|
+
that element.
|
|
900
|
+
|
|
901
|
+
`reducei()` first calls the reducer function with the beginning value, the
|
|
902
|
+
first element in the array, and zero (its index). The result becomes the new
|
|
903
|
+
accumulator value, which is passed to the reducer function along with the
|
|
904
|
+
second element in the array and one (its index). `reducei()` proceeds from left
|
|
905
|
+
to right through the array, passing in the result of each stage as the
|
|
906
|
+
accumulator to the reducer function.
|
|
907
|
+
|
|
908
|
+
When all array elements are processed, the final value of the accumulator
|
|
909
|
+
becomes the return value of `reducei()`. See
|
|
910
|
+
[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
|
|
911
|
+
on MDN.
|
|
912
|
+
|
|
913
|
+
```res example
|
|
914
|
+
// find sum of even-index elements in array
|
|
915
|
+
let sumOfEvens = (accumulator, item, index) =>
|
|
916
|
+
if mod(index, 2) == 0 {
|
|
917
|
+
accumulator + item
|
|
918
|
+
} else {
|
|
919
|
+
accumulator
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
Js.Array2.reducei([2, 5, 1, 4, 3], sumOfEvens, 0) == 6
|
|
923
|
+
```
|
|
924
|
+
*)
|
|
925
|
+
|
|
926
|
+
external reduceRight : 'a t -> (('b -> 'a -> 'b)[@bs.uncurry]) -> 'b -> 'b
|
|
927
|
+
= "reduceRight"
|
|
928
|
+
[@@bs.send]
|
|
929
|
+
(**
|
|
930
|
+
The `reduceRight()` function takes three parameters: an array, a *reducer
|
|
931
|
+
function*, and a beginning accumulator value. The reducer function has two
|
|
932
|
+
parameters: an accumulated value and an element of the array.
|
|
933
|
+
|
|
934
|
+
`reduceRight()` first calls the reducer function with the beginning value and
|
|
935
|
+
the last element in the array. The result becomes the new accumulator value,
|
|
936
|
+
which is passed in to the reducer function along with the next-to-last element
|
|
937
|
+
in the array. `reduceRight()` proceeds from right to left through the array,
|
|
938
|
+
passing in the result of each stage as the accumulator to the reducer function.
|
|
939
|
+
|
|
940
|
+
When all array elements are processed, the final value of the accumulator
|
|
941
|
+
becomes the return value of `reduceRight()`. See
|
|
942
|
+
[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)
|
|
943
|
+
on MDN.
|
|
944
|
+
|
|
945
|
+
**NOTE:** In many cases, `reduce()` and `reduceRight()` give the same result.
|
|
946
|
+
However, see the last example here and compare it to the example from
|
|
947
|
+
`reduce()`, where order makes a difference.
|
|
948
|
+
|
|
949
|
+
```res example
|
|
950
|
+
let sumOfSquares = (accumulator, item) => accumulator + item * item
|
|
951
|
+
|
|
952
|
+
Js.Array2.reduceRight([10, 2, 4], sumOfSquares, 0) == 120
|
|
953
|
+
Js.Array2.reduceRight([2.0, 4.0], (acc, item) => item /. acc, 1.0) == 0.5 // 2.0 / (4.0 / 1.0)
|
|
954
|
+
```
|
|
955
|
+
*)
|
|
956
|
+
|
|
957
|
+
external reduceRighti :
|
|
958
|
+
'a t -> (('b -> 'a -> int -> 'b)[@bs.uncurry]) -> 'b -> 'b = "reduceRight"
|
|
959
|
+
[@@bs.send]
|
|
960
|
+
(**
|
|
961
|
+
The `reduceRighti()` function takes three parameters: an array, a *reducer
|
|
962
|
+
function*, and a beginning accumulator value. The reducer function has three
|
|
963
|
+
parameters: an accumulated value, an element of the array, and the index of
|
|
964
|
+
that element. `reduceRighti()` first calls the reducer function with the
|
|
965
|
+
beginning value, the last element in the array, and its index (length of array
|
|
966
|
+
minus one). The result becomes the new accumulator value, which is passed in to
|
|
967
|
+
the reducer function along with the second element in the array and one (its
|
|
968
|
+
index). `reduceRighti()` proceeds from right to left through the array, passing
|
|
969
|
+
in the result of each stage as the accumulator to the reducer function.
|
|
970
|
+
|
|
971
|
+
When all array elements are processed, the final value of the accumulator
|
|
972
|
+
becomes the return value of `reduceRighti()`. See
|
|
973
|
+
[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)
|
|
974
|
+
on MDN.
|
|
975
|
+
|
|
976
|
+
**NOTE:** In many cases, `reducei()` and `reduceRighti()` give the same result.
|
|
977
|
+
However, there are cases where the order in which items are processed makes a
|
|
978
|
+
difference.
|
|
979
|
+
|
|
980
|
+
```res example
|
|
981
|
+
// find sum of even-index elements in array
|
|
982
|
+
let sumOfEvens = (accumulator, item, index) =>
|
|
983
|
+
if mod(index, 2) == 0 {
|
|
984
|
+
accumulator + item
|
|
985
|
+
} else {
|
|
986
|
+
accumulator
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
Js.Array2.reduceRighti([2, 5, 1, 4, 3], sumOfEvens, 0) == 6
|
|
990
|
+
```
|
|
991
|
+
*)
|
|
992
|
+
|
|
993
|
+
external some : 'a t -> (('a -> bool)[@bs.uncurry]) -> bool = "some"
|
|
994
|
+
[@@bs.send]
|
|
995
|
+
(**
|
|
996
|
+
Returns `true` if the predicate function given as the second argument to
|
|
997
|
+
`some()` returns `true` for any element in the array; `false` otherwise.
|
|
998
|
+
|
|
999
|
+
```res example
|
|
1000
|
+
let isEven = x => mod(x, 2) == 0
|
|
1001
|
+
|
|
1002
|
+
Js.Array2.some([3, 7, 5, 2, 9], isEven) == true
|
|
1003
|
+
Js.Array2.some([3, 7, 5, 1, 9], isEven) == false
|
|
1004
|
+
```
|
|
1005
|
+
*)
|
|
1006
|
+
|
|
1007
|
+
external somei : 'a t -> (('a -> int -> bool)[@bs.uncurry]) -> bool = "some"
|
|
1008
|
+
[@@bs.send]
|
|
1009
|
+
(**
|
|
1010
|
+
Returns `true` if the predicate function given as the second argument to
|
|
1011
|
+
`somei()` returns `true` for any element in the array; `false` otherwise. The
|
|
1012
|
+
predicate function has two arguments: an item from the array and the index
|
|
1013
|
+
value
|
|
1014
|
+
|
|
1015
|
+
```res example
|
|
1016
|
+
// Does any string in the array
|
|
1017
|
+
// have the same length as its index?
|
|
1018
|
+
|
|
1019
|
+
let sameLength = (str, index) => Js.String.length(str) == index
|
|
1020
|
+
|
|
1021
|
+
// "ef" has length 2 and is it at index 2
|
|
1022
|
+
Js.Array2.somei(["ab", "cd", "ef", "gh"], sameLength) == true
|
|
1023
|
+
// no item has the same length as its index
|
|
1024
|
+
Js.Array2.somei(["a", "bc", "def", "gh"], sameLength) == false
|
|
1025
|
+
```
|
|
1026
|
+
*)
|
|
1027
|
+
|
|
1028
|
+
(* commented out until bs has a plan for iterators
|
|
1029
|
+
external values : 'a t -> 'a array_iter = "" [@@bs.send] (* ES2015 *)
|
|
1030
|
+
*)
|
|
1031
|
+
|
|
1032
|
+
external unsafe_get : 'a array -> int -> 'a = "%array_unsafe_get"
|
|
1033
|
+
(**
|
|
1034
|
+
Returns the value at the given position in the array if the position is in
|
|
1035
|
+
bounds; returns the JavaScript value `undefined` otherwise.
|
|
1036
|
+
|
|
1037
|
+
```res example
|
|
1038
|
+
let arr = [100, 101, 102, 103]
|
|
1039
|
+
Js.Array2.unsafe_get(arr, 3) == 103
|
|
1040
|
+
Js.Array2.unsafe_get(arr, 4) // returns undefined
|
|
1041
|
+
```
|
|
1042
|
+
*)
|
|
1043
|
+
|
|
1044
|
+
external unsafe_set : 'a array -> int -> 'a -> unit = "%array_unsafe_set"
|
|
1045
|
+
(**
|
|
1046
|
+
Sets the value at the given position in the array if the position is in bounds.
|
|
1047
|
+
If the index is out of bounds, well, “here there be dragons.“
|
|
1048
|
+
|
|
1049
|
+
*This function modifies the original array.*
|
|
1050
|
+
|
|
1051
|
+
```res example
|
|
1052
|
+
let arr = [100, 101, 102, 103]
|
|
1053
|
+
Js.Array2.unsafe_set(arr, 3, 99)
|
|
1054
|
+
// result is [100, 101, 102, 99];
|
|
1055
|
+
|
|
1056
|
+
Js.Array2.unsafe_set(arr, 4, 88)
|
|
1057
|
+
// result is [100, 101, 102, 99, 88]
|
|
1058
|
+
|
|
1059
|
+
Js.Array2.unsafe_set(arr, 6, 77)
|
|
1060
|
+
// result is [100, 101, 102, 99, 88, <1 empty item>, 77]
|
|
1061
|
+
|
|
1062
|
+
Js.Array2.unsafe_set(arr, -1, 66)
|
|
1063
|
+
// you don't want to know.
|
|
1064
|
+
```
|
|
1065
|
+
*)
|