IC
Size: a a a
DB

IC
VP
AH
IC
AH
DS
IC
AH
IC
DS
DS
// вместо такого:
def createFromString(s: String): MyType = ???
def createFromInt(i: Int): MyType = ???
// делаем вот так:
trait From[T, K] {
def from(t: T): K
}
given From[String, MyType] { def from(s: String): MyType = ??? }
given From[Int, MyType] { def from(s: Int): MyType = ??? }
AH
// вместо такого:
def createFromString(s: String): MyType = ???
def createFromInt(i: Int): MyType = ???
// делаем вот так:
trait From[T, K] {
def from(t: T): K
}
given From[String, MyType] { def from(s: String): MyType = ??? }
given From[Int, MyType] { def from(s: Int): MyType = ??? }
AH
AH
DS
AH
DS
AH