Discord is now Scala’s main chat platform. Please join us at https://discord.com/invite/scala
trait MyTrait[T]
you're saying MyTrait[T]
exists for every T
but if you say trait MyTrait {type T}
you're making no such guarantees
it sort of makes sense... coz when you define
trait MyTrait[T]
you're sayingMyTrait[T]
exists for everyT
but if you saytrait MyTrait {type T}
you're making no such guarantees
yes, you are making a different guarantee, that it exists a T for which MyTrait
exist
Curry-Howard isomorphism
forSome
are existentials, plus there's the fact that abstract types are existential types
, which you are seeing here
or is it the "typeclass trick" using implicits
No, I don't see any relevance to typeclasses and implicits here
Monoid[T]
with anything that has a type parameter and explicit instances, and your question remains the same
Monoid[Int]
, you know that the Monoid is for Int
Model
State
, but you don't know which State
Model
without knowing its State
, you could do that with universal types too no?