|
1 | 1 | module StandardNotation = {
|
2 |
| - external raise: (. exn) => 'a = "%raise" |
3 |
| - let dd = () => raise(. Not_found) |
| 2 | + external raise: exn => 'a = "%raise" |
| 3 | + let dd = () => raise(Not_found) |
4 | 4 |
|
5 |
| - @val external sum: (. float, float) => float = "sum" |
6 |
| - let h = sum(. 1.0, 2.0) |
| 5 | + @val external sum: (float, float) => float = "sum" |
| 6 | + let h = sum(1.0, 2.0) |
7 | 7 |
|
8 | 8 | module M: {
|
9 |
| - let sum: (. float, float) => float |
| 9 | + let sum: (float, float) => float |
10 | 10 | } = {
|
11 |
| - external sum: (. float, float) => float = "sum" |
| 11 | + external sum: (float, float) => float = "sum" |
12 | 12 | }
|
13 |
| - let hh = M.sum(. 1.0, 2.0) |
| 13 | + let hh = M.sum(1.0, 2.0) |
14 | 14 |
|
15 |
| - external mod_float: (. float, float) => float = "?fmod_float" |
16 |
| - let mf = mod_float(. 3., 4.) |
| 15 | + external mod_float: (float, float) => float = "?fmod_float" |
| 16 | + let mf = mod_float(3., 4.) |
17 | 17 |
|
18 |
| - @get_index external get: (. array<string>, int) => option<'a> = "" |
19 |
| - let tg = arr => arr->get(. 0) |
| 18 | + @get_index external get: (array<string>, int) => option<'a> = "" |
| 19 | + let tg = arr => arr->get(0) |
20 | 20 |
|
21 |
| - @val external copy: (. @as(json`{}`) _, string) => string = "Object.assign" |
22 |
| - let tc = copy(. "abc") |
| 21 | + @val external copy: (@as(json`{}`) _, string) => string = "Object.assign" |
| 22 | + let tc = copy("abc") |
23 | 23 |
|
24 |
| - external toException: (. exn) => exn = "%identity" |
25 |
| - let te = toException(. Not_found) |
| 24 | + external toException: exn => exn = "%identity" |
| 25 | + let te = toException(Not_found) |
26 | 26 |
|
27 |
| - @obj external ccreate: (. unit) => string = "" |
28 |
| - let tcr = ccreate(.) |
| 27 | + @obj external ccreate: unit => string = "" |
| 28 | + let tcr = ccreate() |
29 | 29 |
|
30 | 30 | type counter
|
31 | 31 | @set external setIncrementC: (counter, @this (counter, int) => unit) => unit = "increment"
|
32 | 32 | let tsiC = c => setIncrementC(c, @this (me, amount) => Js.log(me))
|
33 |
| - @set external setIncrementU: (. counter, @this (. counter, int) => unit) => unit = "increment" |
34 |
| - let tsiU = c => setIncrementU(.c, @this (. me, amount) => Js.log(me)) |
| 33 | + @set external setIncrementU: (counter, @this (counter, int) => unit) => unit = "increment" |
| 34 | + let tsiU = c => setIncrementU(c, @this (me, amount) => Js.log(me)) |
35 | 35 |
|
36 | 36 | @module("react")
|
37 |
| - external useState: ((unit => 'state)) => ('state, ('state => 'state) => unit) = |
38 |
| - "useState" |
| 37 | + external useState: (unit => 'state) => ('state, ('state => 'state) => unit) = "useState" |
39 | 38 | let (get, set) = useState(() => 3)
|
40 | 39 | }
|
41 | 40 |
|
|
0 commit comments