import com.google.inject._
import net.codingwell.scalaguice._
import scalaz.Reader
class AModule extends AbstractModule with ScalaModule {
def configure() {
bind[Reader[Int, Int]].toInstance(Reader { (_: Int) * 2 })
}
}
gives me error: "Manifest of Reader[Int, Int] is not found"
so I have to resort to the legacy way of creating guice module
class AnotherModule extends AbstractModule {
def configure() {
bind(classOf[Reader[Int, Int]]).toInstance(Reader { (_: Int) * 2 })
}
}
but then when I tried to create instance using scalaguice, got the same error again
val injector = Guice.createInjector(new AnotherModule())
injector.instance[Reader[Int, Int]] // same error as above