These are chat archives for typelevel/scala
Typelevel Scala compiler development and discussion | Latest release TLS 4 for 2.11.11, 2.12.3 and 2.13.0-M2 | Code of conduct http://typelevel.org/conduct.html
Is there an SI for partially applying type arguments? It seems with the changes made for partial unification of higher kinded types, it could be possible to allow something like
def foo[A, B, C](b: B, c: C): A = ??? foo[Int]("string", false) // A is fixed to Int; B and C are inferred as String and Boolean
given that the decision of SI-2712 is for type parameters to always be curried and applied left-to-right. It would have to be extended from kinds to application (which maybe introduces other problems?)
def foo[A][B, C](b: B, c: C): A = ???
Auxpattern, but that doesn't extend to application
Auxcould largely go away, and a lot of shapeless proofs would clean up dramatically
Auxyou find in shapeless that is.
Auxfor things similar to what @sellout linked to, but I think it's not such a good name in that case.
Aux, yes - the pattern of dropping a type parameter into a type member (so it can be inferred) and then capturing it back in a structural type alias
PartiallyAppliedor something like that?
PAT(partially-applied type) until someone at SD decided to repurpose Aux. So I’m on the same page. And alignment with Cats is definitely a valid justification for us. So, 👍🏾
trait FunctionK? I don’t quite see it, but there’s a lot I don’t see.
In theory this commit paves the way to allow polymorphic types as value types. A test of some of the basic functionality is in pending/pos/polyTypes. This does not work yet, because adapt forces every polytype it sees to be fully applied. Enabling this functionality should be a SIP and separate PR.
∀ A. F[A] => G[A]directly
def apply[T](f: F[T]): G[T].
objectcontaining the class (like in our wiki), vs the
class(like in Cats)?
objectversion is maybe slightly more obviously “callable”. ¯\_(ツ)_/¯
private[this]in the cats PR.
def foo[T](implicit ft: F[T])[U <: ft.T](u: U) ...etc.
foo: [X,Y] => Blathen with the named type syntax you could maybe write