Noel M
Noel M

Reputation: 16136

How do I translate this type lambda into Kind-Projector syntax?

Given type parameters of F[_] and A[_] how do I turn the following type lambda into the more pleasant Kind-Projector syntax?

({type λ[α] = F[A[α]]})#λ

I would have imagined it would be something like F[A[?_]], but the compiler complains about wanting type parameters in this case.

Upvotes: 3

Views: 297

Answers (2)

ilinum
ilinum

Reputation: 464

You should use Inline Syntax where possible but in this case you have to use Function Syntax with nested parametrized types.

Also, Intellij IDEA 15 has an inspection to convert type lambdas to kind projector syntax if kind projector is enabled for the project. So this is what the inspection converted your type lambda to: Lambda[α => F[A[α]]]

Upvotes: 0

Noel M
Noel M

Reputation: 16136

Using the Lambda (or λ) syntax worked:

λ[α => F[A[α]]]

Found here under Function Syntax.

Upvotes: 2

Related Questions