Conventions
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can include other contexts through the use of the include
directive."
A block of code is set as follows:
object IOAction { def apply[T](result: => T): IOAction[T] = new SimpleAction[T](result) private class SimpleAction[T](result: => T) extends IOAction[T] { override def apply(state: State): (State, T) = (state.next, result) } }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
abstract class FileIO {
// this makes sure nobody can create a state
private class FileIOState(id: Int) extends State {
override def next: State = new FileIOState(id + 1)
}
def run(args: Array[String]): Unit = {
val action = runIO(args(0), args(1))
action(new FileIOState(0))
}
def runIO(readPath: String, writePath: String): IOAction[_]
}
New terms and important words are shown in bold.
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.