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

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?

1 Like

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

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>]?

1 Like

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

2 Likes