The Neophyte's Guide to Scala
The Neophyte's Guide to Scala
Free!
Minimum price
$14.99
Suggested price
The Neophyte's Guide to Scala

This book is 100% complete

Completed on 2018-02-07

About the Book

The Neophyte's Guide to Scala is a book for intermediate Scala developers. If you have made your first steps with Scala and functional programming, for example by participating in Martin Odersky's Coursera course Functional Programming Principles in Scala, and you don't know how to continue, this book is for you.

Originally published as a blog series from November 2012 to April 2013, the Neophyte's Guide to Scala is now available as an ebook, a compilation of all 16 articles.

In this book, you will learn the details of how to employ pattern matching and extractors, working with the omnipresent Option and similar types in an idiomatic way, and leveraging higher-order functions and currying to keep your code DRY. Furthermore, you will gain insight into advanced Scala features like type classes and path-dependent types and about Scala's approach at concurrent programming: Learn about the power of Scala's futures and the actor model, as implemented in the popular Akka toolkit.

About the Author

Daniel Westheide
Daniel Westheide

Daniel Westheide is a software developer from Berlin, Germany. He has a background in human-computer interaction, semantic web technologies, and adaptive web applications, and has been working as a backend engineer since 2007. He has been using Scala and Clojure professionally since 2011 and likes to spread the love for functional programming and domain-driven design.

Table of Contents

  • Credits
  • Acknowledgements
  • Introduction
  • Extractors
    • Our first extractor, yay!
    • Extracting several values
    • A Boolean extractor
    • Infix operation patterns
    • A closer look at the Stream extractor
    • Using extractors
    • Summary
  • Extracting sequences
    • Example: Extracting given names
    • Combining fixed and variable parameter extraction
    • Summary
  • Patterns everywhere
    • Pattern matching expressions
    • Patterns in value definitions
    • Patterns in for comprehensions
    • Summary
  • Pattern matching anonymous functions
    • Partial functions
    • Summary
  • The Option type
    • The basic idea
    • Creating an option
    • Working with optional values
    • Providing a default value
    • Pattern matching
    • Options can be viewed as collections
    • For comprehensions
    • Chaining options
    • Summary
  • Error handling with Try
    • Throwing and catching exceptions
    • Error handling, the functional way
    • Summary
  • The Either type
    • The semantics
    • Creating an Either
    • Working with Either values
    • When to use Either
    • Summary
  • Welcome to the Future
    • Why sequential code can be bad
    • Semantics of Future
    • Working with Futures
    • Summary
  • Promises and Futures in practice
    • Promises
    • Future-based programming in practice
    • Summary
  • Staying DRY with higher-order functions
    • On higher-order functions
    • And out of nowhere, a function was born
    • Reusing existing functions
    • Function composition
    • Higher-order functions and partial functions
    • Summary
  • Currying and partially applied functions
    • Partially applied functions
    • Spicing up your functions
    • Summary
  • Type classes
    • The problem
    • Type classes to the rescue!
    • Use cases
    • Summary
  • Path-dependent types
    • The problem
    • Safer fiction with path-dependent types
    • Abstract type members
    • Path-dependent types in practice
    • Summary
  • The Actor approach to concurrency
    • The problems with shared mutable state
    • The Actor model
    • Summary
  • Dealing with failure in actor systems
    • Actor hierarchies
    • To crash or not to crash?
    • Summary
  • Where to go from here
    • Teaching Scala
    • Mastering arcane powers
    • Creating something useful
    • Contributing
    • Connecting
    • Other resources
    • Conclusion

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Write and Publish on Leanpub

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub