summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-02-12 12:07:36 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-02-12 12:07:36 +1000
commit7910508d1071e0e769ff6e291d3a1c479a067262 (patch)
tree37ffcb3199917383d39ccaf68785318847142556 /src/library
parenta80f6a00a8519766599e5ca0db61570b7252b584 (diff)
parent51da0e2f6b04c9d1d4630786309f4c4298141727 (diff)
downloadscala-7910508d1071e0e769ff6e291d3a1c479a067262.tar.gz
scala-7910508d1071e0e769ff6e291d3a1c479a067262.tar.bz2
scala-7910508d1071e0e769ff6e291d3a1c479a067262.zip
Merge pull request #4894 from mmynsted/2.12.x
Provide simpler commented example for Future.map
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/concurrent/Future.scala12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala
index e67e698a5c..b10aad0ecc 100644
--- a/src/library/scala/concurrent/Future.scala
+++ b/src/library/scala/concurrent/Future.scala
@@ -245,7 +245,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`