scalaz/scalaz — pull request #479 by retronym (2013-08-21 07:14:31+00:00)
Title: Explicit return types for type class instances for Future/Task

scalac ignores implicits defined below in a file if they are
not type annotated. (Actually, its a bit more complicated -- if those
symbols are initialized because they are referenced from another
file, they would be considered.) These rules are designed to avoid
tripping type inference cycles.

This problem seems to show up in Scala 2.10.3-RC1 for Future and Task.
Full output below. I'm going to investigate this on the scalac side,
`not found: notifyListener` looks to be very fishy!

But this commit sticks to the well trodden and specified parts of
scala'c implicit search.

[warn] 22 warnings found
[info] Compiling 37 Scala sources to /Users/jason/code/scalaz/effect/target/scala-2.10/classes...
[info] Compiling 13 Scala sources to /Users/jason/code/scalaz/concurrent/target/scala-2.10/classes...
[error] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Future.scala:269: not found: value notifyListener
[error] notifyWinner *> notifyListener
[error] ^
[error] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Future.scala:318: could not find implicit value for parameter F0: scalaz.Bind[scalaz.concurrent.Future]
[error] Future(a).join
[error] ^
[error] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Future.scala:318: value join is not a member of scalaz.concurrent.Future[scalaz.concurrent.Future[A]]
[error] Future(a).join
[error] ^
[error] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Task.scala:55: value *> is not a member of scalaz.concurrent.Future[scalaz.\/[Throwable,Unit]]
[error] case -\/(e) => f(Some(e)).get *> Future.now(-\/(e))
[error] ^
[error] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Task.scala:56: value *> is not a member of scalaz.concurrent.Future[scalaz.\/[Throwable,Unit]]
[error] case r => f(None).get *> Future.now(r)
[error] ^
[error] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Task.scala:181: could not find implicit value for parameter F: scalaz.Nondeterminism[scalaz.concurrent.Future]
[error] val F = Nondeterminism[Future]
[error] ^
[error] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Task.scala:180: recursive value F needs type
[error] implicit val taskInstance = new Nondeterminism[Task] with Catchable[Task] {
[error] ^
[error] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Task.scala:235: could not find implicit value for parameter F0: scalaz.Bind[scalaz.concurrent.Task]
[error] apply(a).join
[error] ^
[error] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Task.scala:235: value join is not a member of scalaz.concurrent.Task[scalaz.concurrent.Task[A]]
[error] apply(a).join
[error] ^
[error] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Timer.scala:16: could not find implicit value for parameter F: scalaz.Nondeterminism[scalaz.concurrent.Future]
[error] private[this] val futureNondeterminism = Nondeterminism[Future]
[error] ^
[error] /Users/jason/code/scalaz/concurrent/src/main/scala/scalaz/concurrent/Timer.scala:17: could not find implicit value for parameter F: scalaz.Nondeterminism[scalaz.concurrent.Task]
[error] private[this] val taskNondeterminism = Nondeterminism[Task]
[error] ^
[error] 11 errors found
[error] (concurrent/compile:compile) Compilation failed
[error] Total time: 115 s, completed Aug 21, 2013 9:03:07 AM

Will close #376.