Skip to content
Closed
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
4 changes: 2 additions & 2 deletions jscomp/common/bs_version.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* 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. *)
let version = "2.2.1"
let version = "2.2.2"
let header =
"// Generated by BUCKLESCRIPT VERSION 2.2.1, PLEASE EDIT WITH CARE"
"// Generated by BUCKLESCRIPT VERSION 2.2.2, PLEASE EDIT WITH CARE"
let package_name = "bs-platform"

5 changes: 5 additions & 0 deletions jscomp/others/belt_List.ml
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,11 @@ let toArray ( x : _ t) =
fillAux arr 0 x;
arr

let shuffle xs =
let v = toArray xs in
A.shuffleInPlace v ;
ofArray v

let rec fillAuxMap arr i x f =
match x with
| [] -> ()
Expand Down
6 changes: 6 additions & 0 deletions jscomp/others/belt_List.mli
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ val makeBy: int -> (int -> 'a) -> 'a t
]}
*)

val shuffle: 'a t -> 'a t
(** [shuffle xs]
@return a new list in random order
*)


val drop: 'a t -> int -> 'a t option
(** [drop xs n]

Expand Down
5 changes: 4 additions & 1 deletion jscomp/others/js_null_undefined.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
(** Contains functionality for dealing with values that can be both [null] and [undefined] *)

type + 'a t = 'a Js.nullable
external toOption : 'a t -> 'a option = "#null_undefined_to_opt"
external to_opt : 'a t -> 'a option = "#null_undefined_to_opt"
external return : 'a -> 'a t = "%identity"
external test : 'a t -> bool = "#is_nil_undef"
Expand All @@ -41,7 +42,9 @@ let iter x f =
| None -> ()
| Some x -> f x [@bs]

let from_opt x =
let fromOption x =
match x with
| None -> undefined
| Some x -> return x

let from_opt = fromOption
8 changes: 7 additions & 1 deletion jscomp/others/js_null_undefined.mli
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ val iter : 'a t -> ('a -> unit [@bs]) -> unit
</table>
%}
*)
val from_opt : 'a option -> 'a t
val fromOption : 'a option -> 'a t

val from_opt: 'a option -> 'a t
[@@ocaml.deprecated "Use fromOption instead"]

(** Maps ['a Js.null_undefined] to ['a option]

Expand All @@ -86,4 +89,7 @@ val from_opt : 'a option -> 'a t
</table>
%}
*)
external toOption : 'a t -> 'a option = "#null_undefined_to_opt"

external to_opt : 'a t -> 'a option = "#null_undefined_to_opt"
[@@ocaml.deprecated "Use toOption instead"]
2 changes: 1 addition & 1 deletion jscomp/xwatcher/xwatcher.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';


import * as Path from "path";
import * as Js_option from "../../lib/es6/js_option.js";
Expand Down
2 changes: 1 addition & 1 deletion jscomp/xwatcher/xwatcher_current.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';


import * as Fs from "fs";
import * as Path from "path";
Expand Down
2 changes: 1 addition & 1 deletion jscomp/xwatcher/xwatcher_util.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';


import * as Fs from "fs";
import * as Path from "path";
Expand Down
Binary file added lib/bsb.darwin
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/bsb.ml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ end = struct
* 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. *)
let version = "2.2.1"
let version = "2.2.2"
let header =
"// Generated by BUCKLESCRIPT VERSION 2.2.1, PLEASE EDIT WITH CARE"
"// Generated by BUCKLESCRIPT VERSION 2.2.2, PLEASE EDIT WITH CARE"
let package_name = "bs-platform"

end
Expand Down
Binary file added lib/bsb.win
Binary file not shown.
Binary file added lib/bsb_helper.darwin
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/bsb_helper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ end = struct
* 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. *)
let version = "2.2.1"
let version = "2.2.2"
let header =
"// Generated by BUCKLESCRIPT VERSION 2.2.1, PLEASE EDIT WITH CARE"
"// Generated by BUCKLESCRIPT VERSION 2.2.2, PLEASE EDIT WITH CARE"
let package_name = "bs-platform"

end
Expand Down
Binary file added lib/bsb_helper.win
Binary file not shown.
Binary file added lib/bsc.darwin
Binary file not shown.
Binary file added lib/bsc.win
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/bsdep.ml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ end = struct
* 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. *)
let version = "2.2.1"
let version = "2.2.2"
let header =
"// Generated by BUCKLESCRIPT VERSION 2.2.1, PLEASE EDIT WITH CARE"
"// Generated by BUCKLESCRIPT VERSION 2.2.2, PLEASE EDIT WITH CARE"
let package_name = "bs-platform"

end
Expand Down
Binary file added lib/bsppx.darwin
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/bsppx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15823,9 +15823,9 @@ end = struct
* 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. *)
let version = "2.2.1"
let version = "2.2.2"
let header =
"// Generated by BUCKLESCRIPT VERSION 2.2.1, PLEASE EDIT WITH CARE"
"// Generated by BUCKLESCRIPT VERSION 2.2.2, PLEASE EDIT WITH CARE"
let package_name = "bs-platform"

end
Expand Down
Binary file added lib/bsppx.win
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/es6/js_typed_array.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';



var ArrayBuffer = /* module */[];
Expand Down
7 changes: 7 additions & 0 deletions lib/js/belt_List.js
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,12 @@ function toArray(x) {
return arr;
}

function shuffle(xs) {
var v = toArray(xs);
Belt_Array.shuffleInPlace(v);
return ofArray(v);
}

function reverseConcat(_l1, _l2) {
while(true) {
var l2 = _l2;
Expand Down Expand Up @@ -1463,6 +1469,7 @@ exports.getExn = getExn;
exports.make = make;
exports.makeByU = makeByU;
exports.makeBy = makeBy;
exports.shuffle = shuffle;
exports.drop = drop;
exports.take = take;
exports.splitAt = splitAt;
Expand Down
5 changes: 4 additions & 1 deletion lib/js/js_null_undefined.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ function iter(x, f) {
}
}

function from_opt(x) {
function fromOption(x) {
if (x) {
return x[0];
} else {
return undefined;
}
}

var from_opt = fromOption;

exports.bind = bind;
exports.iter = iter;
exports.fromOption = fromOption;
exports.from_opt = from_opt;
/* No side effect */
Binary file added lib/reactjs_jsx_ppx_2.darwin
Binary file not shown.
Binary file added lib/reactjs_jsx_ppx_2.win
Binary file not shown.
Binary file added lib/refmt.darwin
Binary file not shown.
Binary file added lib/refmt.win
Binary file not shown.
Binary file added lib/refmt3.darwin
Binary file not shown.
Binary file added lib/refmt3.win
Binary file not shown.
Loading