22
33let foo = (x , y ) => x + y
44
5- let z = foo (. 3 , 4 )
5+ let z = foo (3 , 4 )
66
7- let bar = (. x , y ) => x + y
7+ let bar = (x , y ) => x + y
88
99let b = bar (3 , 4 )
1010
1111let w = 3 -> foo (4 )
1212
13- let a = 3 -> foo (. 4 )
13+ let a = 3 -> foo (4 )
1414
1515Js .log (a ) // Test automatic uncurried application
1616
17- let _ = Js .Array2 .map ([1 ], (. x ) => x + 1 )
17+ let _ = Js .Array2 .map ([1 ], x => x + 1 )
1818
19- let ptl = @ res.partial foo (10 ) // force partial application
19+ let ptl = foo (10 , ... ) // force partial application
2020
2121let foo2 = (x , y ) => x + y
2222let bar2 : _ => _ = foo2 (_ , 3 )
@@ -31,7 +31,7 @@ let q: cmp = _ => Jsx.null // Check that subtyping works past type definitions
3131let inl = () => ()
3232
3333@inline
34- let inl2 = (x ,y ) => x + y
34+ let inl2 = (x , y ) => x + y
3535
3636module AllLabels = {
3737 let foo = (~x , ~y , ~z ) => (x , y , z )
@@ -54,7 +54,17 @@ module OptAtEnd = {
5454}
5555
5656module OptMixed = {
57- let foo = (~d1 = "d1=0" , ~x , ~d2 = "d2=0" , ~y , ~d3 = "d3=0" , ~z , ~d4 = "d4=0" , ~w , ~d5 = "d5=0" ) => (d1 , x , d2 , y , d3 , z , d4 , w , d5 )
57+ let foo = (~d1 = "d1=0" , ~x , ~d2 = "d2=0" , ~y , ~d3 = "d3=0" , ~z , ~d4 = "d4=0" , ~w , ~d5 = "d5=0" ) => (
58+ d1 ,
59+ x ,
60+ d2 ,
61+ y ,
62+ d3 ,
63+ z ,
64+ d4 ,
65+ w ,
66+ d5 ,
67+ )
5868
5969 let ptl = foo (~y = "y" , ~w = "w" , ... )
6070
@@ -72,7 +82,7 @@ let fn = cb => {
7282
7383fn (s => Js .log (#foo (s )))
7484
75- let fn1 = (a , b , ()) => a () + b
85+ let fn1 = (a , b , ()) => a () + b
7686
7787let a = fn1 (() => 1 , 2 , _ )
7888
@@ -93,7 +103,7 @@ module PartialApplication = {
93103
94104module ReverseApplication = {
95105 let hello1 = (y , f ) => f (y )
96- let hello2 = (y , f ) => y |> f
106+ let hello2 = (y , f ) => f ( y )
97107}
98108
99109module Pipe = {
@@ -104,4 +114,4 @@ module Pipe = {
104114 let f3 = (foo , x ) => foo (x )
105115
106116 let f4 = (x , f ) => x -> f (3 )
107- }
117+ }
0 commit comments