Skip to content

Commit c730622

Browse files
committed
forgot fmt
1 parent 7a60a6a commit c730622

1 file changed

Lines changed: 29 additions & 14 deletions

File tree

forja/src/Lang.scala

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ object Lang:
7676
type T = T0
7777
}
7878

79-
inline given inst: [S <: Sum] => (list: EffectiveTypeList[S]) => (proj: EffectiveTypeProjection[list.Cases]) => Aux[S, Tuple.Union[proj.T]] =
79+
inline given inst: [S <: Sum] => (list: EffectiveTypeList[S])
80+
=> (proj: EffectiveTypeProjection[list.Cases])
81+
=> Aux[S, Tuple.Union[proj.T]] =
8082
Instanceless[Aux[S, Tuple.Union[proj.T]]]
8183
end inst
8284

@@ -90,12 +92,15 @@ object Lang:
9092
}
9193

9294
object Aux:
93-
inline def apply[Tpl <: Tuple, T <: Tuple](): Aux[Tpl, T] = Instanceless[Aux[Tpl, T]]
95+
inline def apply[Tpl <: Tuple, T <: Tuple](): Aux[Tpl, T] =
96+
Instanceless[Aux[Tpl, T]]
9497
end Aux
9598

9699
inline given empty: Aux[EmptyTuple, EmptyTuple] = Aux()
97100

98-
inline given cons: [Hd <: Node, Tl <: Tuple] => (Hd: Hd) => (rec: EffectiveTypeProjection[Tl]) => Aux[Hd *: Tl, Hd.T *: rec.T] = Aux()
101+
inline given cons: [Hd <: Node, Tl <: Tuple] => (Hd: Hd)
102+
=> (rec: EffectiveTypeProjection[Tl])
103+
=> Aux[Hd *: Tl, Hd.T *: rec.T] = Aux()
99104
end EffectiveTypeProjection
100105
end EffectiveType
101106

@@ -107,13 +112,20 @@ object Lang:
107112
type Aux[S <: Sum, Cases0 <: Tuple] = EffectiveTypeList[S] {
108113
type Cases = Cases0
109114
}
110-
inline def apply[S <: Sum, Cases <: Tuple](): Aux[S, Cases] = Instanceless[Aux[S, Cases]]
115+
inline def apply[S <: Sum, Cases <: Tuple](): Aux[S, Cases] =
116+
Instanceless[Aux[S, Cases]]
111117

112-
inline given instBase: [S <: Sum] => NotGiven[S <:< Sum#Extends] => (S: S) => (mirror: Mirror.SumOf[S.Case]) => (tc: TransformedCases[mirror.MirroredElemTypes]) => EffectiveTypeList.Aux[S, tc.TC] =
118+
inline given instBase: [S <: Sum] => NotGiven[S <:< Sum#Extends] => (S: S)
119+
=> (mirror: Mirror.SumOf[S.Case])
120+
=> (tc: TransformedCases[mirror.MirroredElemTypes])
121+
=> EffectiveTypeList.Aux[S, tc.TC] =
113122
EffectiveTypeList()
114123
end instBase
115124

116-
inline given instExtends: [S <: Sum#Extends] => (S: S) => (rec: EffectiveTypeList[S.Super]) => (mirror: Mirror.SumOf[S.Case]) => (tc: TransformedCases[mirror.MirroredElemTypes]) => EffectiveTypeList.Aux[S, Tuple.Concat[rec.Cases, tc.TC]] =
125+
inline given instExtends: [S <: Sum#Extends] => (S: S)
126+
=> (rec: EffectiveTypeList[S.Super]) => (mirror: Mirror.SumOf[S.Case])
127+
=> (tc: TransformedCases[mirror.MirroredElemTypes])
128+
=> EffectiveTypeList.Aux[S, Tuple.Concat[rec.Cases, tc.TC]] =
117129
EffectiveTypeList()
118130
end instExtends
119131
end EffectiveTypeList
@@ -139,15 +151,15 @@ object Lang:
139151
=> (eht: Lang.EffectiveNodeType[Hd])
140152
=> (ttl: TransformedCases[Tl])
141153
=> TransformedCases.Aux[Hd *: Tl, eht.To *: ttl.TC] =
142-
TransformedCases()
154+
TransformedCases()
143155
end cons
144156

145157
inline given consRetracted: [Hd <: Node, Tl <: Tuple]
146158
=> (Hd: Hd)
147159
=> Hd.Retract
148160
=> (ttl: TransformedCases[Tl])
149161
=> TransformedCases.Aux[Hd *: Tl, ttl.TC] =
150-
TransformedCases()
162+
TransformedCases()
151163
end consRetracted
152164
end TransformedCases
153165
end Sum
@@ -347,7 +359,9 @@ object Test:
347359
sealed trait Case extends Lang.Node
348360
object Case:
349361
export up.Ping.Case.*
350-
object NewCase extends Lang.Term[(s: String, opt: Option[up.Foo.T])], Case
362+
object NewCase
363+
extends Lang.Term[(s: String, opt: Option[up.Foo.T])],
364+
Case
351365
export Case.*
352366
end Ping
353367

@@ -359,19 +373,20 @@ object Test:
359373
val nc: L2.Ping.T = L2.Ping.NewCase(s = "hello", opt = None)
360374
println(nc)
361375

362-
val pong: L2.Ping.T = L2.Ping.Pong(k = 12, foo = L2.Bar(s = "x", opt = None))
376+
val pong: L2.Ping.T =
377+
L2.Ping.Pong(k = 12, foo = L2.Bar(s = "x", opt = None))
363378
println(pong)
364379

365380
nc.ex match
366381
case L2.Ping.NewCase(s, opt) => println(s"NewCase: $s")
367-
case L2.Ping.Pong(k, foo) => println(s"Pong: $k")
368-
case L2.Ping.Bob(k, foo) => println(s"Bob: $k")
382+
case L2.Ping.Pong(k, foo) => println(s"Pong: $k")
383+
case L2.Ping.Bob(k, foo) => println(s"Bob: $k")
369384
end match
370385

371386
pong.ex match
372387
case L2.Ping.NewCase(s, opt) => println(s"NewCase: $s")
373-
case L2.Ping.Pong(k, foo) => println(s"Pong: $k")
374-
case L2.Ping.Bob(k, foo) => println(s"Bob: $k")
388+
case L2.Ping.Pong(k, foo) => println(s"Pong: $k")
389+
case L2.Ping.Bob(k, foo) => println(s"Bob: $k")
375390
end match
376391
end innerSumTest
377392
end Test

0 commit comments

Comments
 (0)