Rob O'Doherty
Rob O'Doherty

Reputation: 569

Why does Functor[A => ?] not compile in Scala 2.11.7?

I am following Michael Pilquist's excellent intro to Functors and my Scala 2.11.7 repl fails to compile(interpret?) the following line.

implicit def function1Functor[X]: Functor[X => ?] = new Functor[X => ?] {
    def map[A, B](fa: X => A)(f: A => B): X => B = fa andThen f
}

Is [X => ?] legal Scala?

I see that he is importing his own simulacrum project at the top of the file but I couldn't determine if it's related.

Upvotes: 1

Views: 96

Answers (1)

Reactormonk
Reactormonk

Reputation: 21690

You'll need the kind projector compiler plugin. https://github.com/non/kind-projector

Upvotes: 6

Related Questions