Skip to content

Commit 0aabd5a

Browse files
committed
use [] and [a] not arrayOf
1 parent 70e2de7 commit 0aabd5a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/Core__Array.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ function findMap(arr, f) {
140140

141141
function fromOption(opt) {
142142
if (opt !== undefined) {
143-
return Array.of(Caml_option.valFromOption(opt));
143+
return [Caml_option.valFromOption(opt)];
144144
} else {
145-
return Array.of();
145+
return [];
146146
}
147147
}
148148

src/Core__Array.res

+2-5
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,8 @@ let findMap = (arr, f) => {
215215

216216
@send external at: (array<'a>, int) => option<'a> = "at"
217217

218-
@val external of0: unit => array<'a> = "Array.of"
219-
@val external of1: 'a => array<'a> = "Array.of"
220-
221218
let fromOption = opt =>
222219
switch opt {
223-
| None => of0()
224-
| Some(a) => of1(a)
220+
| None => []
221+
| Some(a) => [a]
225222
}

0 commit comments

Comments
 (0)