This question is about _ as used in type constructor and not when used in defining existential types.
So the question is what is the difference when _
is used as type parameter instead of a variable like T
. For example difference between F[_]
and F[T]
.
The only difference I can think of is that with F[_]
the parameter itself can have as many holes as possible...that is F[_]
can become F[Int]
or F[Future[Option[Int]]]
etc...while when you have F[T]
the T
can only be a proper type...that is F[String]
or F[Int]
etc.
Is this a correct assumption? and is that the main difference between F[_]
and F[T]
? or there are more?
What about the case where the two are used as type parameters? For example, what is the difference between trait Functor [F[_]]
and trait Functor [F[T]]
?
Is there any semantic difference if the functor trait is defined as trait Functor [F[_]]
instead of trait Functor [F[T]]
?