Skip to content

Commit 2a6f0fa

Browse files
authored
Get rid of @uncurry in ReScript sources (rescript-lang#6938)
* Get rid of @uncurry in ReScript sources * CHANGELOG
1 parent 1617de9 commit 2a6f0fa

18 files changed

+221
-220
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
- Remove `%opaque` primitive. https://github.com/rescript-lang/rescript-compiler/pull/6892
8383
- Reunify JsxC/JsxU -> Jsx etc. https://github.com/rescript-lang/rescript-compiler/pull/6895
8484
- Remove the transformation of `foo(1,2)` into `Js.Internal.opaqueFullApply(Internal.opaque(f), 1, 2)`, and change the back-end to treat all applications as uncurried. https://github.com/rescript-lang/rescript-compiler/pull/6893
85+
- Remove `@uncurry` from ReScript sources (others, tests). https://github.com/rescript-lang/rescript-compiler/pull/6938
8586

8687
#### :nail_care: Polish
8788

Diff for: jscomp/build_tests/react_ppx/src/React.res

+49-49
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module Context = {
5454
external createContext: 'a => Context.t<'a> = "createContext"
5555

5656
@module("react")
57-
external forwardRef: (@uncurry ('props, Js.Nullable.t<Ref.t<'a>>) => element) => component<'props> =
57+
external forwardRef: (('props, Js.Nullable.t<Ref.t<'a>>) => element) => component<'props> =
5858
"forwardRef"
5959

6060
@module("react")
@@ -63,7 +63,7 @@ external memo: component<'props> => component<'props> = "memo"
6363
@module("react")
6464
external memoCustomCompareProps: (
6565
component<'props>,
66-
@uncurry ('props, 'props) => bool,
66+
('props, 'props) => bool,
6767
) => component<'props> = "memo"
6868

6969
module Fragment = {
@@ -101,132 +101,132 @@ module Suspense = {
101101
* only way to safely have any type of state and be able to update it correctly.
102102
*/
103103
@module("react")
104-
external useState: (@uncurry (unit => 'state)) => ('state, ('state => 'state) => unit) = "useState"
104+
external useState: ((unit => 'state)) => ('state, ('state => 'state) => unit) = "useState"
105105

106106
@module("react")
107-
external useReducer: (@uncurry ('state, 'action) => 'state, 'state) => ('state, 'action => unit) =
107+
external useReducer: (('state, 'action) => 'state, 'state) => ('state, 'action => unit) =
108108
"useReducer"
109109

110110
@module("react")
111111
external useReducerWithMapState: (
112-
@uncurry ('state, 'action) => 'state,
112+
('state, 'action) => 'state,
113113
'initialState,
114114
'initialState => 'state,
115115
) => ('state, 'action => unit) = "useReducer"
116116

117117
@module("react")
118-
external useEffect: (@uncurry (unit => option<unit => unit>)) => unit = "useEffect"
118+
external useEffect: ((unit => option<unit => unit>)) => unit = "useEffect"
119119
@module("react")
120-
external useEffect0: (@uncurry (unit => option<unit => unit>), @as(json`[]`) _) => unit =
120+
external useEffect0: ((unit => option<unit => unit>), @as(json`[]`) _) => unit =
121121
"useEffect"
122122
@module("react")
123-
external useEffect1: (@uncurry (unit => option<unit => unit>), array<'a>) => unit = "useEffect"
123+
external useEffect1: ((unit => option<unit => unit>), array<'a>) => unit = "useEffect"
124124
@module("react")
125-
external useEffect2: (@uncurry (unit => option<unit => unit>), ('a, 'b)) => unit = "useEffect"
125+
external useEffect2: ((unit => option<unit => unit>), ('a, 'b)) => unit = "useEffect"
126126
@module("react")
127-
external useEffect3: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c)) => unit = "useEffect"
127+
external useEffect3: ((unit => option<unit => unit>), ('a, 'b, 'c)) => unit = "useEffect"
128128
@module("react")
129-
external useEffect4: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
129+
external useEffect4: ((unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
130130
"useEffect"
131131
@module("react")
132-
external useEffect5: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e)) => unit =
132+
external useEffect5: ((unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e)) => unit =
133133
"useEffect"
134134
@module("react")
135-
external useEffect6: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e, 'f)) => unit =
135+
external useEffect6: ((unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e, 'f)) => unit =
136136
"useEffect"
137137
@module("react")
138138
external useEffect7: (
139-
@uncurry (unit => option<unit => unit>),
139+
(unit => option<unit => unit>),
140140
('a, 'b, 'c, 'd, 'e, 'f, 'g),
141141
) => unit = "useEffect"
142142

143143
@module("react")
144-
external useLayoutEffect: (@uncurry (unit => option<unit => unit>)) => unit = "useLayoutEffect"
144+
external useLayoutEffect: ((unit => option<unit => unit>)) => unit = "useLayoutEffect"
145145
@module("react")
146-
external useLayoutEffect0: (@uncurry (unit => option<unit => unit>), @as(json`[]`) _) => unit =
146+
external useLayoutEffect0: ((unit => option<unit => unit>), @as(json`[]`) _) => unit =
147147
"useLayoutEffect"
148148
@module("react")
149-
external useLayoutEffect1: (@uncurry (unit => option<unit => unit>), array<'a>) => unit =
149+
external useLayoutEffect1: ((unit => option<unit => unit>), array<'a>) => unit =
150150
"useLayoutEffect"
151151
@module("react")
152-
external useLayoutEffect2: (@uncurry (unit => option<unit => unit>), ('a, 'b)) => unit =
152+
external useLayoutEffect2: ((unit => option<unit => unit>), ('a, 'b)) => unit =
153153
"useLayoutEffect"
154154
@module("react")
155-
external useLayoutEffect3: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c)) => unit =
155+
external useLayoutEffect3: ((unit => option<unit => unit>), ('a, 'b, 'c)) => unit =
156156
"useLayoutEffect"
157157
@module("react")
158-
external useLayoutEffect4: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
158+
external useLayoutEffect4: ((unit => option<unit => unit>), ('a, 'b, 'c, 'd)) => unit =
159159
"useLayoutEffect"
160160
@module("react")
161-
external useLayoutEffect5: (@uncurry (unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e)) => unit =
161+
external useLayoutEffect5: ((unit => option<unit => unit>), ('a, 'b, 'c, 'd, 'e)) => unit =
162162
"useLayoutEffect"
163163
@module("react")
164164
external useLayoutEffect6: (
165-
@uncurry (unit => option<unit => unit>),
165+
(unit => option<unit => unit>),
166166
('a, 'b, 'c, 'd, 'e, 'f),
167167
) => unit = "useLayoutEffect"
168168
@module("react")
169169
external useLayoutEffect7: (
170-
@uncurry (unit => option<unit => unit>),
170+
(unit => option<unit => unit>),
171171
('a, 'b, 'c, 'd, 'e, 'f, 'g),
172172
) => unit = "useLayoutEffect"
173173

174174
@module("react")
175-
external useMemo: (@uncurry (unit => 'any)) => 'any = "useMemo"
175+
external useMemo: ((unit => 'any)) => 'any = "useMemo"
176176
@module("react")
177-
external useMemo0: (@uncurry (unit => 'any), @as(json`[]`) _) => 'any = "useMemo"
177+
external useMemo0: ((unit => 'any), @as(json`[]`) _) => 'any = "useMemo"
178178
@module("react")
179-
external useMemo1: (@uncurry (unit => 'any), array<'a>) => 'any = "useMemo"
179+
external useMemo1: ((unit => 'any), array<'a>) => 'any = "useMemo"
180180
@module("react")
181-
external useMemo2: (@uncurry (unit => 'any), ('a, 'b)) => 'any = "useMemo"
181+
external useMemo2: ((unit => 'any), ('a, 'b)) => 'any = "useMemo"
182182
@module("react")
183-
external useMemo3: (@uncurry (unit => 'any), ('a, 'b, 'c)) => 'any = "useMemo"
183+
external useMemo3: ((unit => 'any), ('a, 'b, 'c)) => 'any = "useMemo"
184184
@module("react")
185-
external useMemo4: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd)) => 'any = "useMemo"
185+
external useMemo4: ((unit => 'any), ('a, 'b, 'c, 'd)) => 'any = "useMemo"
186186
@module("react")
187-
external useMemo5: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e)) => 'any = "useMemo"
187+
external useMemo5: ((unit => 'any), ('a, 'b, 'c, 'd, 'e)) => 'any = "useMemo"
188188
@module("react")
189-
external useMemo6: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f)) => 'any = "useMemo"
189+
external useMemo6: ((unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f)) => 'any = "useMemo"
190190
@module("react")
191-
external useMemo7: (@uncurry (unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'any = "useMemo"
191+
external useMemo7: ((unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f, 'g)) => 'any = "useMemo"
192192

193193
/* This is used as return values */
194194
type callback<'input, 'output> = 'input => 'output
195195

196196
@module("react")
197-
external useCallback: (@uncurry ('input => 'output)) => callback<'input, 'output> = "useCallback"
197+
external useCallback: (('input => 'output)) => callback<'input, 'output> = "useCallback"
198198
@module("react")
199199
external useCallback0: (
200-
@uncurry ('input => 'output),
200+
('input => 'output),
201201
@as(json`[]`) _,
202202
) => callback<'input, 'output> = "useCallback"
203203
@module("react")
204-
external useCallback1: (@uncurry ('input => 'output), array<'a>) => callback<'input, 'output> =
204+
external useCallback1: (('input => 'output), array<'a>) => callback<'input, 'output> =
205205
"useCallback"
206206
@module("react")
207-
external useCallback2: (@uncurry ('input => 'output), ('a, 'b)) => callback<'input, 'output> =
207+
external useCallback2: (('input => 'output), ('a, 'b)) => callback<'input, 'output> =
208208
"useCallback"
209209
@module("react")
210-
external useCallback3: (@uncurry ('input => 'output), ('a, 'b, 'c)) => callback<'input, 'output> =
210+
external useCallback3: (('input => 'output), ('a, 'b, 'c)) => callback<'input, 'output> =
211211
"useCallback"
212212
@module("react")
213213
external useCallback4: (
214-
@uncurry ('input => 'output),
214+
('input => 'output),
215215
('a, 'b, 'c, 'd),
216216
) => callback<'input, 'output> = "useCallback"
217217
@module("react")
218218
external useCallback5: (
219-
@uncurry ('input => 'output),
219+
('input => 'output),
220220
('a, 'b, 'c, 'd, 'e),
221221
) => callback<'input, 'output> = "useCallback"
222222
@module("react")
223223
external useCallback6: (
224-
@uncurry ('input => 'output),
224+
('input => 'output),
225225
('a, 'b, 'c, 'd, 'e, 'f),
226226
) => callback<'input, 'output> = "useCallback"
227227
@module("react")
228228
external useCallback7: (
229-
@uncurry ('input => 'output),
229+
('input => 'output),
230230
('a, 'b, 'c, 'd, 'e, 'f, 'g),
231231
) => callback<'input, 'output> = "useCallback"
232232

@@ -238,56 +238,56 @@ external useContext: Context.t<'any> => 'any = "useContext"
238238
@module("react")
239239
external useImperativeHandle0: (
240240
Js.Nullable.t<Ref.t<'value>>,
241-
@uncurry (unit => 'value),
241+
(unit => 'value),
242242
@as(json`[]`) _,
243243
) => unit = "useImperativeHandle"
244244

245245
@module("react")
246246
external useImperativeHandle1: (
247247
Js.Nullable.t<Ref.t<'value>>,
248-
@uncurry (unit => 'value),
248+
(unit => 'value),
249249
array<'a>,
250250
) => unit = "useImperativeHandle"
251251

252252
@module("react")
253253
external useImperativeHandle2: (
254254
Js.Nullable.t<Ref.t<'value>>,
255-
@uncurry (unit => 'value),
255+
(unit => 'value),
256256
('a, 'b),
257257
) => unit = "useImperativeHandle"
258258

259259
@module("react")
260260
external useImperativeHandle3: (
261261
Js.Nullable.t<Ref.t<'value>>,
262-
@uncurry (unit => 'value),
262+
(unit => 'value),
263263
('a, 'b, 'c),
264264
) => unit = "useImperativeHandle"
265265

266266
@module("react")
267267
external useImperativeHandle4: (
268268
Js.Nullable.t<Ref.t<'value>>,
269-
@uncurry (unit => 'value),
269+
(unit => 'value),
270270
('a, 'b, 'c, 'd),
271271
) => unit = "useImperativeHandle"
272272

273273
@module("react")
274274
external useImperativeHandle5: (
275275
Js.Nullable.t<Ref.t<'value>>,
276-
@uncurry (unit => 'value),
276+
(unit => 'value),
277277
('a, 'b, 'c, 'd, 'e),
278278
) => unit = "useImperativeHandle"
279279

280280
@module("react")
281281
external useImperativeHandle6: (
282282
Js.Nullable.t<Ref.t<'value>>,
283-
@uncurry (unit => 'value),
283+
(unit => 'value),
284284
('a, 'b, 'c, 'd, 'e, 'f),
285285
) => unit = "useImperativeHandle"
286286

287287
@module("react")
288288
external useImperativeHandle7: (
289289
Js.Nullable.t<Ref.t<'value>>,
290-
@uncurry (unit => 'value),
290+
(unit => 'value),
291291
('a, 'b, 'c, 'd, 'e, 'f, 'g),
292292
) => unit = "useImperativeHandle"
293293

0 commit comments

Comments
 (0)