-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
191 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
|
||
|
||
|
||
hierachy | ||
|
||
# set | ||
## bs_internalAVLset (basic module with rotation) | ||
|
||
methods in this moudle could be shared by (at least 2 of them) | ||
|
||
fuctional set, functional specialized set | ||
mutable set, mutable specialized set. | ||
|
||
for example, [mem0] could be shared by functional/mutable poly set | ||
|
||
|
||
## bs_Set | ||
functional poly set (depends on bs_internalAVLset) | ||
|
||
## intenral_set.cppo.ml | ||
## bs_intenralSetInt | ||
## bs_internalSetString | ||
|
||
methods could be shared by funcitional/imperative specialized set. | ||
This intermediate module is created since we want to share methods | ||
like [findOpt], [cmp] | ||
|
||
## set.cppo.ml | ||
## bs_SetInt | ||
## bs_SetString | ||
|
||
|
||
|
||
## setm.cpp.ml | ||
## bs_SetIntM | ||
## bs_SetStringM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
(* Copyright (C) 2018 Authors of BuckleScript | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* In addition to the permissions granted to you by the LGPL, you may combine | ||
* or link a "work that uses the Library" with a publicly distributed version | ||
* of this file to produce a combined library or application, then distribute | ||
* that combined work under the terms of your choosing, with no requirement | ||
* to comply with the obligations normally placed on you by section 4 of the | ||
* LGPL version 3 (or the corresponding section of a later version of the LGPL | ||
* should you choose to use a later version). | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) | ||
|
||
type 'a opt = 'a Js.undefined | ||
type 'c container = | ||
private { | ||
mutable size: int; (* number of entries *) | ||
mutable buckets: 'c opt array; (* the buckets *) | ||
|
||
} [@@bs.deriving abstract] | ||
|
||
external toOpt : 'a opt -> 'a option = "#undefined_to_opt" | ||
external return : 'a -> 'a opt = "%identity" | ||
|
||
val emptyOpt : 'a Js.undefined | ||
val create0 : int -> 'a container | ||
val clear0 : 'a container -> unit | ||
val reset0 : 'a container -> unit | ||
val length0 : 'a container -> int | ||
type statistics = { | ||
num_bindings : int; | ||
num_buckets : int; | ||
max_bucket_length : int; | ||
bucket_histogram : int array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
(* Copyright (C) 2018 Authors of BuckleScript | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* In addition to the permissions granted to you by the LGPL, you may combine | ||
* or link a "work that uses the Library" with a publicly distributed version | ||
* of this file to produce a combined library or application, then distribute | ||
* that combined work under the terms of your choosing, with no requirement | ||
* to comply with the obligations normally placed on you by section 4 of the | ||
* LGPL version 3 (or the corresponding section of a later version of the LGPL | ||
* should you choose to use a later version). | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) | ||
|
||
module C = Bs_internalBucketsType | ||
|
||
type 'a bucket = { | ||
mutable key : 'a; | ||
mutable next : 'a bucket C.opt | ||
} | ||
and 'a t0 = 'a bucket C.container | ||
[@@bs.deriving abstract] | ||
|
||
|
||
val iter0 : 'a bucket C.container -> ('a -> 'b [@bs]) -> unit | ||
val fillArray : int -> 'a array -> 'a bucket -> int | ||
val toArray0 : 'a bucket C.container -> 'a array | ||
|
||
val fold0 : 'a bucket C.container -> 'b -> ('a -> 'b -> 'b [@bs]) -> 'b | ||
val logStats0 : 'a bucket C.container -> unit |
Oops, something went wrong.