@tellahq/rescript 10.1.4-republish-2 → 10.1.4-republish-3
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/darwin/bsb_helper.exe +0 -0
- package/darwin/bsc.exe +0 -0
- package/darwin/ninja.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.exe +0 -0
- package/darwinarm64/rescript.exe +0 -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 +316 -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_promise2.cmi +0 -0
- package/lib/ocaml/js_promise2.cmt +0 -0
- package/lib/ocaml/js_promise2.res +58 -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.res +40 -0
- package/lib/ocaml/jsxDOM.cmi +0 -0
- package/lib/ocaml/jsxDOM.cmt +0 -0
- package/lib/ocaml/jsxDOM.res +620 -0
- package/lib/ocaml/jsxDOMStyle.cmi +0 -0
- package/lib/ocaml/jsxDOMStyle.cmt +0 -0
- package/lib/ocaml/jsxDOMStyle.ml +781 -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/jsxPPXReactSupport.cmi +0 -0
- package/lib/ocaml/jsxPPXReactSupport.cmt +0 -0
- package/lib/ocaml/jsxPPXReactSupport.res +48 -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 +75 -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.exe +0 -0
- package/linux/rescript.exe +0 -0
- package/ninja.COPYING +202 -0
- package/package.json +1 -1
- package/vendor/ninja.tar.gz +0 -0
- package/win32/bsb_helper.exe +0 -0
- package/win32/bsc.exe +0 -0
- package/win32/ninja.exe +0 -0
- package/win32/refmt.exe +0 -0
- package/win32/rescript.exe +0 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
(**************************************************************************)
|
|
2
|
+
(* *)
|
|
3
|
+
(* OCaml *)
|
|
4
|
+
(* *)
|
|
5
|
+
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
6
|
+
(* *)
|
|
7
|
+
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
|
8
|
+
(* en Automatique. *)
|
|
9
|
+
(* *)
|
|
10
|
+
(* All rights reserved. This file is distributed under the terms of *)
|
|
11
|
+
(* the GNU Lesser General Public License version 2.1, with the *)
|
|
12
|
+
(* special exception on linking described in the file LICENSE. *)
|
|
13
|
+
(* *)
|
|
14
|
+
(**************************************************************************)
|
|
15
|
+
|
|
16
|
+
(** Byte sequence operations.
|
|
17
|
+
|
|
18
|
+
A byte sequence is a mutable data structure that contains a
|
|
19
|
+
fixed-length sequence of bytes. Each byte can be indexed in
|
|
20
|
+
constant time for reading or writing.
|
|
21
|
+
|
|
22
|
+
Given a byte sequence [s] of length [l], we can access each of the
|
|
23
|
+
[l] bytes of [s] via its index in the sequence. Indexes start at
|
|
24
|
+
[0], and we will call an index valid in [s] if it falls within the
|
|
25
|
+
range [[0...l-1]] (inclusive). A position is the point between two
|
|
26
|
+
bytes or at the beginning or end of the sequence. We call a
|
|
27
|
+
position valid in [s] if it falls within the range [[0...l]]
|
|
28
|
+
(inclusive). Note that the byte at index [n] is between positions
|
|
29
|
+
[n] and [n+1].
|
|
30
|
+
|
|
31
|
+
Two parameters [start] and [len] are said to designate a valid
|
|
32
|
+
range of [s] if [len >= 0] and [start] and [start+len] are valid
|
|
33
|
+
positions in [s].
|
|
34
|
+
|
|
35
|
+
Byte sequences can be modified in place, for instance via the [set]
|
|
36
|
+
and [blit] functions described below. See also strings (module
|
|
37
|
+
{!String}), which are almost the same data structure, but cannot be
|
|
38
|
+
modified in place.
|
|
39
|
+
|
|
40
|
+
Bytes are represented by the OCaml type [char].
|
|
41
|
+
|
|
42
|
+
@since 4.02.0
|
|
43
|
+
*)
|
|
44
|
+
|
|
45
|
+
external length : bytes -> int = "%bytes_length"
|
|
46
|
+
(** Return the length (number of bytes) of the argument. *)
|
|
47
|
+
|
|
48
|
+
external get : bytes -> int -> char = "%bytes_safe_get"
|
|
49
|
+
(** [get s n] returns the byte at index [n] in argument [s].
|
|
50
|
+
|
|
51
|
+
Raise [Invalid_argument] if [n] is not a valid index in [s]. *)
|
|
52
|
+
|
|
53
|
+
external set : bytes -> int -> char -> unit = "%bytes_safe_set"
|
|
54
|
+
(** [set s n c] modifies [s] in place, replacing the byte at index [n]
|
|
55
|
+
with [c].
|
|
56
|
+
|
|
57
|
+
Raise [Invalid_argument] if [n] is not a valid index in [s]. *)
|
|
58
|
+
|
|
59
|
+
external create : int -> bytes = "?create_bytes"
|
|
60
|
+
(** [create n] returns a new byte sequence of length [n]. The
|
|
61
|
+
sequence is uninitialized and contains arbitrary bytes.
|
|
62
|
+
|
|
63
|
+
Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. *)
|
|
64
|
+
|
|
65
|
+
val make : int -> char -> bytes
|
|
66
|
+
(** [make n c] returns a new byte sequence of length [n], filled with
|
|
67
|
+
the byte [c].
|
|
68
|
+
|
|
69
|
+
Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. *)
|
|
70
|
+
|
|
71
|
+
val init : int -> (int -> char) -> bytes
|
|
72
|
+
(** [Bytes.init n f] returns a fresh byte sequence of length [n], with
|
|
73
|
+
character [i] initialized to the result of [f i] (in increasing
|
|
74
|
+
index order).
|
|
75
|
+
|
|
76
|
+
Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. *)
|
|
77
|
+
|
|
78
|
+
val empty : bytes
|
|
79
|
+
(** A byte sequence of size 0. *)
|
|
80
|
+
|
|
81
|
+
val copy : bytes -> bytes
|
|
82
|
+
(** Return a new byte sequence that contains the same bytes as the
|
|
83
|
+
argument. *)
|
|
84
|
+
|
|
85
|
+
val of_string : string -> bytes
|
|
86
|
+
(** Return a new byte sequence that contains the same bytes as the
|
|
87
|
+
given string. *)
|
|
88
|
+
|
|
89
|
+
val to_string : bytes -> string
|
|
90
|
+
(** Return a new string that contains the same bytes as the given byte
|
|
91
|
+
sequence. *)
|
|
92
|
+
|
|
93
|
+
val sub : bytes -> int -> int -> bytes
|
|
94
|
+
(** [sub s start len] returns a new byte sequence of length [len],
|
|
95
|
+
containing the subsequence of [s] that starts at position [start]
|
|
96
|
+
and has length [len].
|
|
97
|
+
|
|
98
|
+
Raise [Invalid_argument] if [start] and [len] do not designate a
|
|
99
|
+
valid range of [s]. *)
|
|
100
|
+
|
|
101
|
+
val sub_string : bytes -> int -> int -> string
|
|
102
|
+
(** Same as [sub] but return a string instead of a byte sequence. *)
|
|
103
|
+
|
|
104
|
+
val extend : bytes -> int -> int -> bytes
|
|
105
|
+
(** [extend s left right] returns a new byte sequence that contains
|
|
106
|
+
the bytes of [s], with [left] uninitialized bytes prepended and
|
|
107
|
+
[right] uninitialized bytes appended to it. If [left] or [right]
|
|
108
|
+
is negative, then bytes are removed (instead of appended) from
|
|
109
|
+
the corresponding side of [s].
|
|
110
|
+
|
|
111
|
+
Raise [Invalid_argument] if the result length is negative or
|
|
112
|
+
longer than {!Sys.max_string_length} bytes. *)
|
|
113
|
+
|
|
114
|
+
val fill : bytes -> int -> int -> char -> unit
|
|
115
|
+
(** [fill s start len c] modifies [s] in place, replacing [len]
|
|
116
|
+
characters with [c], starting at [start].
|
|
117
|
+
|
|
118
|
+
Raise [Invalid_argument] if [start] and [len] do not designate a
|
|
119
|
+
valid range of [s]. *)
|
|
120
|
+
|
|
121
|
+
val blit : bytes -> int -> bytes -> int -> int -> unit
|
|
122
|
+
(** [blit src srcoff dst dstoff len] copies [len] bytes from sequence
|
|
123
|
+
[src], starting at index [srcoff], to sequence [dst], starting at
|
|
124
|
+
index [dstoff]. It works correctly even if [src] and [dst] are the
|
|
125
|
+
same byte sequence, and the source and destination intervals
|
|
126
|
+
overlap.
|
|
127
|
+
|
|
128
|
+
Raise [Invalid_argument] if [srcoff] and [len] do not
|
|
129
|
+
designate a valid range of [src], or if [dstoff] and [len]
|
|
130
|
+
do not designate a valid range of [dst]. *)
|
|
131
|
+
|
|
132
|
+
val blit_string : string -> int -> bytes -> int -> int -> unit
|
|
133
|
+
(** [blit src srcoff dst dstoff len] copies [len] bytes from string
|
|
134
|
+
[src], starting at index [srcoff], to byte sequence [dst],
|
|
135
|
+
starting at index [dstoff].
|
|
136
|
+
|
|
137
|
+
Raise [Invalid_argument] if [srcoff] and [len] do not
|
|
138
|
+
designate a valid range of [src], or if [dstoff] and [len]
|
|
139
|
+
do not designate a valid range of [dst]. *)
|
|
140
|
+
|
|
141
|
+
val concat : bytes -> bytes list -> bytes
|
|
142
|
+
(** [concat sep sl] concatenates the list of byte sequences [sl],
|
|
143
|
+
inserting the separator byte sequence [sep] between each, and
|
|
144
|
+
returns the result as a new byte sequence.
|
|
145
|
+
|
|
146
|
+
Raise [Invalid_argument] if the result is longer than
|
|
147
|
+
{!Sys.max_string_length} bytes. *)
|
|
148
|
+
|
|
149
|
+
val cat : bytes -> bytes -> bytes
|
|
150
|
+
(** [cat s1 s2] concatenates [s1] and [s2] and returns the result
|
|
151
|
+
as new byte sequence.
|
|
152
|
+
|
|
153
|
+
Raise [Invalid_argument] if the result is longer than
|
|
154
|
+
{!Sys.max_string_length} bytes. *)
|
|
155
|
+
|
|
156
|
+
val iter : (char -> unit) -> bytes -> unit
|
|
157
|
+
(** [iter f s] applies function [f] in turn to all the bytes of [s].
|
|
158
|
+
It is equivalent to [f (get s 0); f (get s 1); ...; f (get s
|
|
159
|
+
(length s - 1)); ()]. *)
|
|
160
|
+
|
|
161
|
+
val iteri : (int -> char -> unit) -> bytes -> unit
|
|
162
|
+
(** Same as {!Bytes.iter}, but the function is applied to the index of
|
|
163
|
+
the byte as first argument and the byte itself as second
|
|
164
|
+
argument. *)
|
|
165
|
+
|
|
166
|
+
val map : (char -> char) -> bytes -> bytes
|
|
167
|
+
(** [map f s] applies function [f] in turn to all the bytes of [s]
|
|
168
|
+
(in increasing index order) and stores the resulting bytes in
|
|
169
|
+
a new sequence that is returned as the result. *)
|
|
170
|
+
|
|
171
|
+
val mapi : (int -> char -> char) -> bytes -> bytes
|
|
172
|
+
(** [mapi f s] calls [f] with each character of [s] and its
|
|
173
|
+
index (in increasing index order) and stores the resulting bytes
|
|
174
|
+
in a new sequence that is returned as the result. *)
|
|
175
|
+
|
|
176
|
+
val trim : bytes -> bytes
|
|
177
|
+
(** Return a copy of the argument, without leading and trailing
|
|
178
|
+
whitespace. The bytes regarded as whitespace are the ASCII
|
|
179
|
+
characters [' '], ['\012'], ['\n'], ['\r'], and ['\t']. *)
|
|
180
|
+
|
|
181
|
+
val escaped : bytes -> bytes
|
|
182
|
+
(** Return a copy of the argument, with special characters represented
|
|
183
|
+
by escape sequences, following the lexical conventions of OCaml.
|
|
184
|
+
All characters outside the ASCII printable range (32..126) are
|
|
185
|
+
escaped, as well as backslash and double-quote.
|
|
186
|
+
|
|
187
|
+
Raise [Invalid_argument] if the result is longer than
|
|
188
|
+
{!Sys.max_string_length} bytes. *)
|
|
189
|
+
|
|
190
|
+
val index : bytes -> char -> int
|
|
191
|
+
(** [index s c] returns the index of the first occurrence of byte [c]
|
|
192
|
+
in [s].
|
|
193
|
+
|
|
194
|
+
Raise [Not_found] if [c] does not occur in [s]. *)
|
|
195
|
+
|
|
196
|
+
val index_opt: bytes -> char -> int option
|
|
197
|
+
(** [index_opt s c] returns the index of the first occurrence of byte [c]
|
|
198
|
+
in [s] or [None] if [c] does not occur in [s].
|
|
199
|
+
@since 4.05 *)
|
|
200
|
+
|
|
201
|
+
val rindex : bytes -> char -> int
|
|
202
|
+
(** [rindex s c] returns the index of the last occurrence of byte [c]
|
|
203
|
+
in [s].
|
|
204
|
+
|
|
205
|
+
Raise [Not_found] if [c] does not occur in [s]. *)
|
|
206
|
+
|
|
207
|
+
val rindex_opt: bytes -> char -> int option
|
|
208
|
+
(** [rindex_opt s c] returns the index of the last occurrence of byte [c]
|
|
209
|
+
in [s] or [None] if [c] does not occur in [s].
|
|
210
|
+
@since 4.05 *)
|
|
211
|
+
|
|
212
|
+
val index_from : bytes -> int -> char -> int
|
|
213
|
+
(** [index_from s i c] returns the index of the first occurrence of
|
|
214
|
+
byte [c] in [s] after position [i]. [Bytes.index s c] is
|
|
215
|
+
equivalent to [Bytes.index_from s 0 c].
|
|
216
|
+
|
|
217
|
+
Raise [Invalid_argument] if [i] is not a valid position in [s].
|
|
218
|
+
Raise [Not_found] if [c] does not occur in [s] after position [i]. *)
|
|
219
|
+
|
|
220
|
+
val index_from_opt: bytes -> int -> char -> int option
|
|
221
|
+
(** [index_from _opts i c] returns the index of the first occurrence of
|
|
222
|
+
byte [c] in [s] after position [i] or [None] if [c] does not occur in [s] after position [i].
|
|
223
|
+
[Bytes.index_opt s c] is equivalent to [Bytes.index_from_opt s 0 c].
|
|
224
|
+
|
|
225
|
+
Raise [Invalid_argument] if [i] is not a valid position in [s].
|
|
226
|
+
@since 4.05 *)
|
|
227
|
+
|
|
228
|
+
val rindex_from : bytes -> int -> char -> int
|
|
229
|
+
(** [rindex_from s i c] returns the index of the last occurrence of
|
|
230
|
+
byte [c] in [s] before position [i+1]. [rindex s c] is equivalent
|
|
231
|
+
to [rindex_from s (Bytes.length s - 1) c].
|
|
232
|
+
|
|
233
|
+
Raise [Invalid_argument] if [i+1] is not a valid position in [s].
|
|
234
|
+
Raise [Not_found] if [c] does not occur in [s] before position [i+1]. *)
|
|
235
|
+
|
|
236
|
+
val rindex_from_opt: bytes -> int -> char -> int option
|
|
237
|
+
(** [rindex_from_opt s i c] returns the index of the last occurrence
|
|
238
|
+
of byte [c] in [s] before position [i+1] or [None] if [c] does not
|
|
239
|
+
occur in [s] before position [i+1]. [rindex_opt s c] is equivalent to
|
|
240
|
+
[rindex_from s (Bytes.length s - 1) c].
|
|
241
|
+
|
|
242
|
+
Raise [Invalid_argument] if [i+1] is not a valid position in [s].
|
|
243
|
+
@since 4.05 *)
|
|
244
|
+
|
|
245
|
+
val contains : bytes -> char -> bool
|
|
246
|
+
(** [contains s c] tests if byte [c] appears in [s]. *)
|
|
247
|
+
|
|
248
|
+
val contains_from : bytes -> int -> char -> bool
|
|
249
|
+
(** [contains_from s start c] tests if byte [c] appears in [s] after
|
|
250
|
+
position [start]. [contains s c] is equivalent to [contains_from
|
|
251
|
+
s 0 c].
|
|
252
|
+
|
|
253
|
+
Raise [Invalid_argument] if [start] is not a valid position in [s]. *)
|
|
254
|
+
|
|
255
|
+
val rcontains_from : bytes -> int -> char -> bool
|
|
256
|
+
(** [rcontains_from s stop c] tests if byte [c] appears in [s] before
|
|
257
|
+
position [stop+1].
|
|
258
|
+
|
|
259
|
+
Raise [Invalid_argument] if [stop < 0] or [stop+1] is not a valid
|
|
260
|
+
position in [s]. *)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
val uppercase_ascii : bytes -> bytes
|
|
264
|
+
(** Return a copy of the argument, with all lowercase letters
|
|
265
|
+
translated to uppercase, using the US-ASCII character set.
|
|
266
|
+
@since 4.03.0 *)
|
|
267
|
+
|
|
268
|
+
val lowercase_ascii : bytes -> bytes
|
|
269
|
+
(** Return a copy of the argument, with all uppercase letters
|
|
270
|
+
translated to lowercase, using the US-ASCII character set.
|
|
271
|
+
@since 4.03.0 *)
|
|
272
|
+
|
|
273
|
+
val capitalize_ascii : bytes -> bytes
|
|
274
|
+
(** Return a copy of the argument, with the first character set to uppercase,
|
|
275
|
+
using the US-ASCII character set.
|
|
276
|
+
@since 4.03.0 *)
|
|
277
|
+
|
|
278
|
+
val uncapitalize_ascii : bytes -> bytes
|
|
279
|
+
(** Return a copy of the argument, with the first character set to lowercase,
|
|
280
|
+
using the US-ASCII character set.
|
|
281
|
+
@since 4.03.0 *)
|
|
282
|
+
|
|
283
|
+
type t = bytes
|
|
284
|
+
(** An alias for the type of byte sequences. *)
|
|
285
|
+
|
|
286
|
+
val compare: t -> t -> int
|
|
287
|
+
(** The comparison function for byte sequences, with the same
|
|
288
|
+
specification as {!Pervasives.compare}. Along with the type [t],
|
|
289
|
+
this function [compare] allows the module [Bytes] to be passed as
|
|
290
|
+
argument to the functors {!Set.Make} and {!Map.Make}. *)
|
|
291
|
+
|
|
292
|
+
val equal: t -> t -> bool
|
|
293
|
+
(** The equality function for byte sequences.
|
|
294
|
+
@since 4.03.0 *)
|
|
295
|
+
|
|
296
|
+
(** {3 Unsafe conversions (for advanced users)}
|
|
297
|
+
|
|
298
|
+
This section describes unsafe, low-level conversion functions
|
|
299
|
+
between [bytes] and [string]. They do not copy the internal data;
|
|
300
|
+
used improperly, they can break the immutability invariant on
|
|
301
|
+
strings provided by the [-safe-string] option. They are available for
|
|
302
|
+
expert library authors, but for most purposes you should use the
|
|
303
|
+
always-correct {!Bytes.to_string} and {!Bytes.of_string} instead.
|
|
304
|
+
*)
|
|
305
|
+
|
|
306
|
+
val unsafe_to_string : bytes -> string
|
|
307
|
+
(** Unsafely convert a byte sequence into a string.
|
|
308
|
+
|
|
309
|
+
To reason about the use of [unsafe_to_string], it is convenient to
|
|
310
|
+
consider an "ownership" discipline. A piece of code that
|
|
311
|
+
manipulates some data "owns" it; there are several disjoint ownership
|
|
312
|
+
modes, including:
|
|
313
|
+
- Unique ownership: the data may be accessed and mutated
|
|
314
|
+
- Shared ownership: the data has several owners, that may only
|
|
315
|
+
access it, not mutate it.
|
|
316
|
+
|
|
317
|
+
Unique ownership is linear: passing the data to another piece of
|
|
318
|
+
code means giving up ownership (we cannot write the
|
|
319
|
+
data again). A unique owner may decide to make the data shared
|
|
320
|
+
(giving up mutation rights on it), but shared data may not become
|
|
321
|
+
uniquely-owned again.
|
|
322
|
+
|
|
323
|
+
[unsafe_to_string s] can only be used when the caller owns the byte
|
|
324
|
+
sequence [s] -- either uniquely or as shared immutable data. The
|
|
325
|
+
caller gives up ownership of [s], and gains ownership of the
|
|
326
|
+
returned string.
|
|
327
|
+
|
|
328
|
+
There are two valid use-cases that respect this ownership
|
|
329
|
+
discipline:
|
|
330
|
+
|
|
331
|
+
1. Creating a string by initializing and mutating a byte sequence
|
|
332
|
+
that is never changed after initialization is performed.
|
|
333
|
+
|
|
334
|
+
{[
|
|
335
|
+
let string_init len f : string =
|
|
336
|
+
let s = Bytes.create len in
|
|
337
|
+
for i = 0 to len - 1 do Bytes.set s i (f i) done;
|
|
338
|
+
Bytes.unsafe_to_string s
|
|
339
|
+
]}
|
|
340
|
+
|
|
341
|
+
This function is safe because the byte sequence [s] will never be
|
|
342
|
+
accessed or mutated after [unsafe_to_string] is called. The
|
|
343
|
+
[string_init] code gives up ownership of [s], and returns the
|
|
344
|
+
ownership of the resulting string to its caller.
|
|
345
|
+
|
|
346
|
+
Note that it would be unsafe if [s] was passed as an additional
|
|
347
|
+
parameter to the function [f] as it could escape this way and be
|
|
348
|
+
mutated in the future -- [string_init] would give up ownership of
|
|
349
|
+
[s] to pass it to [f], and could not call [unsafe_to_string]
|
|
350
|
+
safely.
|
|
351
|
+
|
|
352
|
+
We have provided the {!String.init}, {!String.map} and
|
|
353
|
+
{!String.mapi} functions to cover most cases of building
|
|
354
|
+
new strings. You should prefer those over [to_string] or
|
|
355
|
+
[unsafe_to_string] whenever applicable.
|
|
356
|
+
|
|
357
|
+
2. Temporarily giving ownership of a byte sequence to a function
|
|
358
|
+
that expects a uniquely owned string and returns ownership back, so
|
|
359
|
+
that we can mutate the sequence again after the call ended.
|
|
360
|
+
|
|
361
|
+
{[
|
|
362
|
+
let bytes_length (s : bytes) =
|
|
363
|
+
String.length (Bytes.unsafe_to_string s)
|
|
364
|
+
]}
|
|
365
|
+
|
|
366
|
+
In this use-case, we do not promise that [s] will never be mutated
|
|
367
|
+
after the call to [bytes_length s]. The {!String.length} function
|
|
368
|
+
temporarily borrows unique ownership of the byte sequence
|
|
369
|
+
(and sees it as a [string]), but returns this ownership back to
|
|
370
|
+
the caller, which may assume that [s] is still a valid byte
|
|
371
|
+
sequence after the call. Note that this is only correct because we
|
|
372
|
+
know that {!String.length} does not capture its argument -- it could
|
|
373
|
+
escape by a side-channel such as a memoization combinator.
|
|
374
|
+
|
|
375
|
+
The caller may not mutate [s] while the string is borrowed (it has
|
|
376
|
+
temporarily given up ownership). This affects concurrent programs,
|
|
377
|
+
but also higher-order functions: if {!String.length} returned
|
|
378
|
+
a closure to be called later, [s] should not be mutated until this
|
|
379
|
+
closure is fully applied and returns ownership.
|
|
380
|
+
*)
|
|
381
|
+
|
|
382
|
+
val unsafe_of_string : string -> bytes
|
|
383
|
+
(** Unsafely convert a shared string to a byte sequence that should
|
|
384
|
+
not be mutated.
|
|
385
|
+
|
|
386
|
+
The same ownership discipline that makes [unsafe_to_string]
|
|
387
|
+
correct applies to [unsafe_of_string]: you may use it if you were
|
|
388
|
+
the owner of the [string] value, and you will own the return
|
|
389
|
+
[bytes] in the same mode.
|
|
390
|
+
|
|
391
|
+
In practice, unique ownership of string values is extremely
|
|
392
|
+
difficult to reason about correctly. You should always assume
|
|
393
|
+
strings are shared, never uniquely owned.
|
|
394
|
+
|
|
395
|
+
For example, string literals are implicitly shared by the
|
|
396
|
+
compiler, so you never uniquely own them.
|
|
397
|
+
|
|
398
|
+
{[
|
|
399
|
+
let incorrect = Bytes.unsafe_of_string "hello"
|
|
400
|
+
let s = Bytes.of_string "hello"
|
|
401
|
+
]}
|
|
402
|
+
|
|
403
|
+
The first declaration is incorrect, because the string literal
|
|
404
|
+
["hello"] could be shared by the compiler with other parts of the
|
|
405
|
+
program, and mutating [incorrect] is a bug. You must always use
|
|
406
|
+
the second version, which performs a copy and is thus correct.
|
|
407
|
+
|
|
408
|
+
Assuming unique ownership of strings that are not string
|
|
409
|
+
literals, but are (partly) built from string literals, is also
|
|
410
|
+
incorrect. For example, mutating [unsafe_of_string ("foo" ^ s)]
|
|
411
|
+
could mutate the shared string ["foo"] -- assuming a rope-like
|
|
412
|
+
representation of strings. More generally, functions operating on
|
|
413
|
+
strings will assume shared ownership, they do not preserve unique
|
|
414
|
+
ownership. It is thus incorrect to assume unique ownership of the
|
|
415
|
+
result of [unsafe_of_string].
|
|
416
|
+
|
|
417
|
+
The only case we have reasonable confidence is safe is if the
|
|
418
|
+
produced [bytes] is shared -- used as an immutable byte
|
|
419
|
+
sequence. This is possibly useful for incremental migration of
|
|
420
|
+
low-level programs that manipulate immutable sequences of bytes
|
|
421
|
+
(for example {!Marshal.from_bytes}) and previously used the
|
|
422
|
+
[string] type for this purpose.
|
|
423
|
+
*)
|
|
424
|
+
|
|
425
|
+
(**/**)
|
|
426
|
+
|
|
427
|
+
(* The following is for system use only. Do not call directly. *)
|
|
428
|
+
|
|
429
|
+
external unsafe_get : bytes -> int -> char = "%bytes_unsafe_get"
|
|
430
|
+
external unsafe_set : bytes -> int -> char -> unit = "%bytes_unsafe_set"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|