diff options
author | Mark Mynsted <code@growingliberty.com> | 2016-01-04 22:17:08 -0600 |
---|---|---|
committer | Mark Mynsted <code@growingliberty.com> | 2016-01-19 23:57:20 -0600 |
commit | 51da0e2f6b04c9d1d4630786309f4c4298141727 (patch) | |
tree | 6e9581ff3f44c563c3ea6f081519b3bc19f7e98a | |
parent | ed74a84113fab294391eda19efab6d172f414c01 (diff) | |
download | scala-51da0e2f6b04c9d1d4630786309f4c4298141727.tar.gz scala-51da0e2f6b04c9d1d4630786309f4c4298141727.tar.bz2 scala-51da0e2f6b04c9d1d4630786309f4c4298141727.zip |
Making commented example simpler for map
Adding connection between map and for
As described by SethTisue.
Removing parentheses
Fixing scaladoc
-rw-r--r-- | src/library/scala/concurrent/Future.scala | 12 |
1 files changed, 11 insertions, 1 deletions
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` |