Skip to content

Convert Belt sources to .res #6271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 39 additions & 50 deletions jscomp/others/belt.ml → jscomp/others/belt.res
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
/* Copyright (C) 2015-2016 Bloomberg Finance L.P.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -20,9 +20,9 @@
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

(** The ReScript standard library.
/*** The ReScript standard library.

Belt is currently mostly covering collection types. It has no string or date functions yet, although Belt.String is in the works. In the meantime, use [Js.String](js/string) for string functions and [Js.Date](js/date) for date functions.

Expand Down Expand Up @@ -200,61 +200,61 @@ let mySet2: t<(int, int), Comparable2.identity>

`Comparable1.identity` and `Comparable2.identity` are not the same using our encoding scheme.

*)
*/

[@@@warning "-49"]
@@warning("-49")

(** [`Belt.Id`]()
/** [`Belt.Id`]()

Provide utilities to create identified comparators or hashes for
data structures used below.

It create a unique identifier per module of
functions so that different data structures with slightly different
comparison functions won't mix
*)
*/
module Id = Belt_Id

(** [`Belt.Array`]()
/** [`Belt.Array`]()

**mutable array**: Utilities functions
*)
*/
module Array = Belt_Array

(** [`Belt.SortArray`]()
/** [`Belt.SortArray`]()

The top level provides some generic sort related utilities.

It also has two specialized inner modules
[`Belt.SortArray.Int`]() and [`Belt.SortArray.String`]()
*)
*/
module SortArray = Belt_SortArray

(** [`Belt.MutableQueue`]()
/** [`Belt.MutableQueue`]()

An FIFO(first in first out) queue data structure
*)
*/
module MutableQueue = Belt_MutableQueue

(** [`Belt.MutableStack`]()
/** [`Belt.MutableStack`]()

An FILO(first in last out) stack data structure
*)
*/
module MutableStack = Belt_MutableStack

(** [`Belt.List`]()
/** [`Belt.List`]()

Utilities for List data type
*)
*/
module List = Belt_List

(** [`Belt.Range`]()
/** [`Belt.Range`]()

Utilities for a closed range `(from, start)`
*)
*/
module Range = Belt_Range

(** [`Belt.Set`]()
/** [`Belt.Set`]()

The top level provides generic **immutable** set operations.

Expand All @@ -264,11 +264,10 @@ module Range = Belt_Range
[`Belt.Set.Dict`](): This module separates data from function
which is more verbose but slightly more efficient

*)
*/
module Set = Belt_Set


(** [`Belt.Map`](),
/** [`Belt.Map`](),

The top level provides generic **immutable** map operations.

Expand All @@ -277,76 +276,66 @@ module Set = Belt_Set

[`Belt.Map.Dict`](): This module separates data from function
which is more verbose but slightly more efficient
*)
*/
module Map = Belt_Map


(** [`Belt.MutableSet`]()
/** [`Belt.MutableSet`]()

The top level provides generic **mutable** set operations.

It also has two specialized inner modules
[`Belt.MutableSet.Int`]() and [`Belt.MutableSet.String`]()
*)
*/
module MutableSet = Belt_MutableSet

(** [`Belt.MutableMap`]()
/** [`Belt.MutableMap`]()

The top level provides generic **mutable** map operations.

It also has two specialized inner modules
[`Belt.MutableMap.Int`]() and [`Belt.MutableMap.String`]()

*)
*/
module MutableMap = Belt_MutableMap


(** [`Belt.HashSet`]()
/** [`Belt.HashSet`]()

The top level provides generic **mutable** hash set operations.

It also has two specialized inner modules
[`Belt.HashSet.Int`]() and [`Belt.HashSet.String`]()
*)
*/
module HashSet = Belt_HashSet


(** [`Belt.HashMap`]()
/** [`Belt.HashMap`]()

The top level provides generic **mutable** hash map operations.

It also has two specialized inner modules
[`Belt.HashMap.Int`]() and [`Belt.HashMap.String`]()
*)
*/
module HashMap = Belt_HashMap


(** [`Belt.Option`]()
/** [`Belt.Option`]()

Utilities for option data type.
*)
*/
module Option = Belt_Option


(** [`Belt.Result`]()
/** [`Belt.Result`]()

Utilities for result data type.
*)

*/
module Result = Belt_Result

(** [`Belt.Int`]()
/** [`Belt.Int`]()

Utilities for Int.
*)

*/
module Int = Belt_Int

(** [`Belt.Float`]()
/** [`Belt.Float`]()

Utilities for Float.
*)

*/
module Float = Belt_Float


Loading