Do the syntaxes for existential types and higher kinded types confuse you?


#1

Currently existential types and higher kinded types share similar syntaxes, and sometimes it confuses some people:

// This function call has an existential type as a type parameter
weakTypeOf[Cond[_]]

// This function declaration has a higher kinded type parameter
def weakTypeOf1[Cond[_]]: Type = ???

What we should do next? There are two options:

Which one do you prefer? Why? Do you have other solutions?


#2

Note that in dotty’s proposal, the wildcard could be used to partially apply a type constructor, which is a very interesting feature.


#3

There is also another issue with higher-kinded types.
Say I have the following trait:
trait Foo[HK[_,_], A]

How can I write something like: Foo[_[_,_],_] or just Foo[<Don't care>]?


#4

In Dotty you can write Foo[_, _], a wildcard can be used where a type constrructor is expected.