1
+
2
+
3
+ def f1 [T ][U ](x : T , y : U ): (T , U ) = (x, y)
4
+ def f2 [T ](x : T )[U ](y : U ): (T , U ) = (x, y)
5
+
6
+
7
+ def foo [T , U ][V ](x : T ): U = ???
8
+
9
+ @ main def test = foo[Int ] // should probably not work (and doesn't)
10
+
11
+ // check ce qui se passe quand appelée
12
+ // def f3[T][U]: [X] => F[X]
13
+ // done: voir higherKindedReturn.scala
14
+
15
+ // reflechir quoi changer dans la spe pour rendre le currying/interweaving dans la doc
16
+ // https://www.scala-lang.org/files/archive/spec/2.13/06-expressions.html
17
+ //
18
+ // Only need to change definitions, as applications can also be of that form, see higherKindedReturn.scala:11
19
+ /*
20
+ * in https://www.scala-lang.org/files/archive/spec/2.13/04-basic-declarations-and-definitions.html#function-declarations-and-definitions
21
+ * Change:
22
+ *
23
+ * FunSig ::= id ParamClauses
24
+ * ParamClauses ::= ParamClause {ParamClause}
25
+ * ParamClause ::= TermParamClause | TypeParamClause | UsingParamClause
26
+ * TermParamClause ::= [nl] ‘(’ [TermParams] ‘)’ //note: allows ()
27
+ * TypeParamClause ::= [nl] ‘[’ TypeParams ‘]’
28
+ * UsingParamClause ::= [nl] ‘(’ ‘using’ TermParams ‘)’
29
+ *
30
+ * (slightly simpler but should be equivalent to changes made in Parser.scla)
31
+ */
32
+ // same for classes, je suis un peu confus par la syntaxe ci-dessous, notament Annotation et AccessModifiers, ils sont pas là en scala 3, non ?
33
+ // https://www.scala-lang.org/files/archive/spec/2.13/05-classes-and-objects.html#class-definitions
34
+
35
+ // impl param de classe, déjà Parser
36
+
37
+
38
+ // Que faire de TypeDcl ::= id [TypeParamClause] {FunParamClause} TypeBounds [‘=’ Type] //TODO: change to {ParamClauses} ?
39
+
40
+
41
+ /* Endroits à changer: (toujour creation et application)
42
+ function definition Done
43
+ function application Already works
44
+ class definition In Progress
45
+ class instantiation Might already work
46
+ given definition Todo
47
+ given application(?) Doesn't exist ? or add multiple params to usings ?
48
+ type declarations To be determined
49
+ type instantiation Doesn't exist ?
50
+ extension definition Todo
51
+ extension application Todo
52
+ */
53
+
54
+
55
+
56
+ // étapes pour "convaincre"
57
+ // 1) exemples simples, et exemples d'utilité
58
+ // 2) expliquer intuitivement
59
+ // 3) update la doc
60
+ // 4) PR et tout le tralala
61
+
62
+
63
+ // potentiellement cette feature en experimental
64
+
65
+ // eta expension:
66
+ val f = foo // should work and doesn't preserve type params yet
0 commit comments