Tutorial by Examples

Do not overcomplicate simple tasks. Most of the time you will need only: algebraic datatypes structural recursion monad-like api (map, flatMap, fold) There is plenty of complicated stuff in Scala, such as: Cake pattern or Reader Monad for Dependency Injection. Passing arbitrary values as...
Find meaningful names for computation units. Use for comprehensions or map to combine computations together. Let's say you have something like this: if (userAuthorized.nonEmtpy) { makeRequest().map { case Success(respone) => someProcessing(..) if (resendToUser) { ...
By default: Use val, not var, wherever possible. This allows you to take seamless advantage of a number of functional utilities, including work distribution. Use recursion and comprehensionss, not loops. Use immutable collections. This is a corrolary to using val whenever possible. Focus on da...

Page 1 of 1