From 51da0e2f6b04c9d1d4630786309f4c4298141727 Mon Sep 17 00:00:00 2001 From: Mark Mynsted Date: Mon, 4 Jan 2016 22:17:08 -0600 Subject: Making commented example simpler for map Adding connection between map and for As described by SethTisue. Removing parentheses Fixing scaladoc --- src/library/scala/concurrent/Future.scala | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala index f49536d351..490f84e76c 100644 --- a/src/library/scala/concurrent/Future.scala +++ b/src/library/scala/concurrent/Future.scala @@ -243,7 +243,17 @@ trait Future[+T] extends Awaitable[T] { * this future. If this future is completed with an exception then the new * future will also contain this exception. * - * $forComprehensionExamples + * Example: + * + * {{{ + * val f = Future { "The future" } + * val g = f map { x: String => x + " is now!" } + * }}} + * + * Note that a for comprehension involving a `Future` + * may expand to include a call to `map` and or `flatMap` + * and `withFilter`. See [[scala.concurrent.Future#flatMap]] for an example of such a comprehension. + * * * @tparam S the type of the returned `Future` * @param f the function which will be applied to the successful result of this `Future` -- cgit v1.2.3