February 2018
Intermediate to advanced
552 pages
13h 46m
English
So far, we did simple Marble diagrams, which apply only one function at a time. However, we can compose functions one by one in a sequential order to solve some complex problems easily and in an elegant way.
Now, we will draw Marble diagram for the concat() and sorted() functions. Let's consider some Scala code using these two functions:
scala> val hello = "Hello" hello: String = Hello scala> val world = "World" world: String = World scala> hello.concat(world) res17: String = HelloWorld scala> hello.concat(world).sorted res19: String = Hwdellloor
We can represent them as a Marble diagram, as follows:
Read now
Unlock full access