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:
Patrik Nordwall 2019-02-09 15:25:39 +01:00
parent e4d38f92a4
commit 5c96a5f556
1521 changed files with 18846 additions and 18786 deletions

View file

@ -24,15 +24,15 @@ class RateTransformationDocSpec extends AkkaSpec {
//#conflate-summarize
val statsFlow = Flow[Double]
.conflateWithSeed(immutable.Seq(_))(_ :+ _)
.map { s
.map { s =>
val μ = s.sum / s.size
val se = s.map(x pow(x - μ, 2))
val se = s.map(x => pow(x - μ, 2))
val σ = sqrt(se.sum / se.size)
(σ, μ, s.size)
}
//#conflate-summarize
val fut = Source.fromIterator(() Iterator.continually(Random.nextGaussian))
val fut = Source.fromIterator(() => Iterator.continually(Random.nextGaussian))
.via(statsFlow)
.grouped(10)
.runWith(Sink.head)
@ -45,8 +45,8 @@ class RateTransformationDocSpec extends AkkaSpec {
val p = 0.01
val sampleFlow = Flow[Double]
.conflateWithSeed(immutable.Seq(_)) {
case (acc, elem) if Random.nextDouble < p acc :+ elem
case (acc, _) acc
case (acc, elem) if Random.nextDouble < p => acc :+ elem
case (acc, _) => acc
}
.mapConcat(identity)
//#conflate-sample
@ -97,11 +97,11 @@ class RateTransformationDocSpec extends AkkaSpec {
"extrapolate should track drift" in {
//#extrapolate-drift
val driftFlow = Flow[Double].map(_ -> 0)
.extrapolate[(Double, Int)] { case (i, _) Iterator.from(1).map(i -> _) }
.extrapolate[(Double, Int)] { case (i, _) => Iterator.from(1).map(i -> _) }
//#extrapolate-drift
val latch = TestLatch(2)
val realDriftFlow = Flow[Double].map(d { latch.countDown(); d -> 0; })
.extrapolate[(Double, Int)] { case (d, _) latch.countDown(); Iterator.from(1).map(d -> _) }
val realDriftFlow = Flow[Double].map(d => { latch.countDown(); d -> 0; })
.extrapolate[(Double, Int)] { case (d, _) => latch.countDown(); Iterator.from(1).map(d -> _) }
val (pub, sub) = TestSource.probe[Double]
.via(realDriftFlow)
@ -123,11 +123,11 @@ class RateTransformationDocSpec extends AkkaSpec {
"expand should track drift" in {
//#expand-drift
val driftFlow = Flow[Double]
.expand(i Iterator.from(0).map(i -> _))
.expand(i => Iterator.from(0).map(i -> _))
//#expand-drift
val latch = TestLatch(2)
val realDriftFlow = Flow[Double]
.expand(d { latch.countDown(); Iterator.from(0).map(d -> _) })
.expand(d => { latch.countDown(); Iterator.from(0).map(d -> _) })
val (pub, sub) = TestSource.probe[Double]
.via(realDriftFlow)