@@ -83,10 +83,10 @@ let getOrThrow: result<'a, 'b> => 'a
83
83
84
84
```rescript
85
85
let ok = Ok(42)
86
- Result.mapOr(ok, 0, (x) => x / 2) == 21
86
+ Result.mapOr(ok, 0, x => x / 2) == 21
87
87
88
88
let error = Error("Invalid data")
89
- Result.mapOr(error, 0, (x) => x / 2) == 0
89
+ Result.mapOr(error, 0, x => x / 2) == 0
90
90
```
91
91
*/
92
92
let mapOr : (result <'a , 'c >, 'b , 'a => 'b ) => 'b
@@ -102,7 +102,7 @@ ordinary value.
102
102
## Examples
103
103
104
104
```rescript
105
- let f = (x) => sqrt(Int.toFloat(x))
105
+ let f = x => sqrt(Int.toFloat(x))
106
106
107
107
Result.map(Ok(64), f) == Ok(8.0)
108
108
@@ -119,8 +119,8 @@ unchanged. Function `f` takes a value of the same type as `n` and returns a
119
119
## Examples
120
120
121
121
```rescript
122
- let recip = (x) =>
123
- if ( x !== 0.0) {
122
+ let recip = x =>
123
+ if x !== 0.0 {
124
124
Ok(1.0 /. x)
125
125
} else {
126
126
Error("Divide by zero")
@@ -219,11 +219,11 @@ let mod10cmp = (a, b) => Int.compare(mod(a, 10), mod(b, 10))
219
219
220
220
Result.compare(Ok(39), Ok(57), mod10cmp) == 1.
221
221
222
- Result.compare(Ok(57), Ok(39), mod10cmp) == ( -1.)
222
+ Result.compare(Ok(57), Ok(39), mod10cmp) == -1.
223
223
224
224
Result.compare(Ok(39), Error("y"), mod10cmp) == 1.
225
225
226
- Result.compare(Error("x"), Ok(57), mod10cmp) == ( -1.)
226
+ Result.compare(Error("x"), Ok(57), mod10cmp) == -1.
227
227
228
228
Result.compare(Error("x"), Error("y"), mod10cmp) == 0.
229
229
```
0 commit comments