replace unicode arrows
* ⇒, →, ← * because we don't want to show them in documentation snippets and then it's complicated to avoid that when snippets are located in src/test/scala in individual modules * dont replace object `→` in FSM.scala and PersistentFSM.scala
This commit is contained in:
parent
e4d38f92a4
commit
5c96a5f556
1521 changed files with 18846 additions and 18786 deletions
|
|
@ -14,6 +14,6 @@ object Map {
|
|||
|
||||
//#map
|
||||
val source: Source[Int, NotUsed] = Source(1 to 10)
|
||||
val mapped: Source[String, NotUsed] = source.map(elem ⇒ elem.toString)
|
||||
val mapped: Source[String, NotUsed] = source.map(elem => elem.toString)
|
||||
//#map
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ object SourceOperators {
|
|||
implicit val materializer: ActorMaterializer = ActorMaterializer()
|
||||
|
||||
val source: Source[Int, NotUsed] = Source.fromFuture(Future.successful(10))
|
||||
val sink: Sink[Int, Future[Done]] = Sink.foreach((i: Int) ⇒ println(i))
|
||||
val sink: Sink[Int, Future[Done]] = Sink.foreach((i: Int) => println(i))
|
||||
|
||||
val done: Future[Done] = source.runWith(sink) //10
|
||||
//#sourceFromFuture
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ object SourceOrFlow {
|
|||
//#conflate
|
||||
import scala.concurrent.duration._
|
||||
|
||||
Source.cycle(() ⇒ List(1, 10, 100, 1000).iterator)
|
||||
Source.cycle(() => List(1, 10, 100, 1000).iterator)
|
||||
.throttle(10, per = 1.second) // faster upstream
|
||||
.conflate((acc, el) ⇒ acc + el) // acc: Int, el: Int
|
||||
.conflate((acc, el) => acc + el) // acc: Int, el: Int
|
||||
.throttle(1, per = 1.second) // slow downstream
|
||||
//#conflate
|
||||
}
|
||||
|
|
@ -45,9 +45,9 @@ object SourceOrFlow {
|
|||
def sum(other: Summed) = Summed(this.i + other.i)
|
||||
}
|
||||
|
||||
Source.cycle(() ⇒ List(1, 10, 100, 1000).iterator)
|
||||
Source.cycle(() => List(1, 10, 100, 1000).iterator)
|
||||
.throttle(10, per = 1.second) // faster upstream
|
||||
.conflateWithSeed(el ⇒ Summed(el))((acc, el) ⇒ acc sum Summed(el)) // (Summed, Int) => Summed
|
||||
.conflateWithSeed(el => Summed(el))((acc, el) => acc sum Summed(el)) // (Summed, Int) => Summed
|
||||
.throttle(1, per = 1.second) // slow downstream
|
||||
//#conflateWithSeed
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ object SourceOrFlow {
|
|||
|
||||
//#scan
|
||||
val source = Source(1 to 5)
|
||||
source.scan(0)((acc, x) ⇒ acc + x).runForeach(println)
|
||||
source.scan(0)((acc, x) => acc + x).runForeach(println)
|
||||
// 0 (= 0)
|
||||
// 1 (= 0 + 1)
|
||||
// 3 (= 0 + 1 + 2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue