Skip to content

Commit 2ae7fd8

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

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
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

0 commit comments

Comments
 (0)