Skip to content

Commit 0730463

Browse files
committed
rename fOk, fError to eqOk, eqError, cmpOk, cmpError
1 parent 2ac2542 commit 0730463

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

packages/@rescript/runtime/Stdlib_Result.res

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,20 @@ let isError = x =>
7777
| Error(_) => true
7878
}
7979

80-
let equal = (a, b, fOk, fError) =>
80+
let equal = (a, b, eqOk, eqError) =>
8181
switch (a, b) {
82-
| (Ok(a), Ok(b)) => fOk(a, b)
82+
| (Ok(a), Ok(b)) => eqOk(a, b)
8383
| (Error(_), Ok(_))
8484
| (Ok(_), Error(_)) => false
85-
| (Error(a), Error(b)) => fError(a, b)
85+
| (Error(a), Error(b)) => eqError(a, b)
8686
}
8787

88-
let compare = (a, b, fOk, fError) =>
88+
let compare = (a, b, cmpOk, cmpError) =>
8989
switch (a, b) {
90-
| (Ok(a), Ok(b)) => fOk(a, b)
90+
| (Ok(a), Ok(b)) => cmpOk(a, b)
9191
| (Error(_), Ok(_)) => Stdlib_Ordering.less
9292
| (Ok(_), Error(_)) => Stdlib_Ordering.greater
93-
| (Error(a), Error(b)) => fError(a, b)
93+
| (Error(a), Error(b)) => cmpError(a, b)
9494
}
9595

9696
let forEach = (r, f) =>

packages/@rescript/runtime/Stdlib_Result.resi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ let isOk: result<'a, 'b> => bool
172172
let isError: result<'a, 'b> => bool
173173

174174
/**
175-
`equal(res1, res2, fOk, fError)`: Determine if two `Result` variables are equal with
175+
`equal(res1, res2, eqOk, eqError)`: Determine if two `Result` variables are equal with
176176
respect to equality functions. If `res1` and `res2` are of the form `Ok(n)`
177-
and `Ok(m)`, return the result of `fOk(n, m)`. If one of `res1` and `res2` are of
177+
and `Ok(m)`, return the result of `eqOk(n, m)`. If one of `res1` and `res2` are of
178178
the form `Error(e)`, return false If both `res1` and `res2` are of the form
179-
`Error(e)`, return the result of `fError(e1, e2)`.
179+
`Error(e)`, return the result of `eqError(e1, e2)`.
180180
181181
## Examples
182182
@@ -203,16 +203,16 @@ Result.equal(bad1, bad2, mod10equal, String.equal) == false
203203
let equal: (result<'a, 'c>, result<'b, 'd>, ('a, 'b) => bool, ('c, 'd) => bool) => bool
204204

205205
/**
206-
`compare(res1, res2, fOk, fError)`: Compare two `Result` variables with respect to a
206+
`compare(res1, res2, cmpOk, cmpError)`: Compare two `Result` variables with respect to a
207207
comparison function. The comparison function returns -1. if the first variable
208208
is "less than" the second, 0. if the two variables are equal, and 1. if the first
209209
is "greater than" the second.
210210
211211
If `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of
212-
`fOk(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,
212+
`cmpOk(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,
213213
return -1. (nothing is less than something) If `res1` is of the form `Ok(n)` and
214214
`res2` is of the form `Error(e)`, return 1. (something is greater than nothing) If
215-
both `res1` and `res2` are of the form `Error(e)`, return fError(e1, e2).
215+
both `res1` and `res2` are of the form `Error(e)`, return cmpError(e1, e2).
216216
217217
## Examples
218218

packages/@rescript/runtime/lib/es6/Stdlib_Result.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,31 @@ function isError(x) {
5353
return x.TAG !== "Ok";
5454
}
5555

56-
function equal(a, b, fOk, fError) {
56+
function equal(a, b, eqOk, eqError) {
5757
if (a.TAG === "Ok") {
5858
if (b.TAG === "Ok") {
59-
return fOk(a._0, b._0);
59+
return eqOk(a._0, b._0);
6060
} else {
6161
return false;
6262
}
6363
} else if (b.TAG === "Ok") {
6464
return false;
6565
} else {
66-
return fError(a._0, b._0);
66+
return eqError(a._0, b._0);
6767
}
6868
}
6969

70-
function compare(a, b, fOk, fError) {
70+
function compare(a, b, cmpOk, cmpError) {
7171
if (a.TAG === "Ok") {
7272
if (b.TAG === "Ok") {
73-
return fOk(a._0, b._0);
73+
return cmpOk(a._0, b._0);
7474
} else {
7575
return 1;
7676
}
7777
} else if (b.TAG === "Ok") {
7878
return -1;
7979
} else {
80-
return fError(a._0, b._0);
80+
return cmpError(a._0, b._0);
8181
}
8282
}
8383

packages/@rescript/runtime/lib/js/Stdlib_Result.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,31 @@ function isError(x) {
5353
return x.TAG !== "Ok";
5454
}
5555

56-
function equal(a, b, fOk, fError) {
56+
function equal(a, b, eqOk, eqError) {
5757
if (a.TAG === "Ok") {
5858
if (b.TAG === "Ok") {
59-
return fOk(a._0, b._0);
59+
return eqOk(a._0, b._0);
6060
} else {
6161
return false;
6262
}
6363
} else if (b.TAG === "Ok") {
6464
return false;
6565
} else {
66-
return fError(a._0, b._0);
66+
return eqError(a._0, b._0);
6767
}
6868
}
6969

70-
function compare(a, b, fOk, fError) {
70+
function compare(a, b, cmpOk, cmpError) {
7171
if (a.TAG === "Ok") {
7272
if (b.TAG === "Ok") {
73-
return fOk(a._0, b._0);
73+
return cmpOk(a._0, b._0);
7474
} else {
7575
return 1;
7676
}
7777
} else if (b.TAG === "Ok") {
7878
return -1;
7979
} else {
80-
return fError(a._0, b._0);
80+
return cmpError(a._0, b._0);
8181
}
8282
}
8383

0 commit comments

Comments
 (0)