Functional programming in Scala

Instructors:

Alfonso Roa

Location:
Sales innovation School
Date:
June, 2019
Duration:
16 hours

Overview

The main goal of this course is introducing the basic functional programming techniques that fuel the most advanced libraries and applications nowadays (Spark, Twitter, Facebook, etc.). These techniques are, amongst others, algebraic data types, higher-order functions, type classes, monads and pure functions. Throughout the course, you will learn what these techniques are, and, specially, why we should care about them, i.e. how they will help us to achieve higher levels of reusability, testability, evolvability, etc., in our code. Last, note that this is a functional programming course that happens to be taught using Scala. So, the major lessons to be learned here will be readily applicable to your everyday programming tasks, even if you can't use Scala at your workplace (sigh).

Objectives

At the end of the course, attendees should be able to:
  • Understand the essence of functional programming, and why you should embrace it.
  • Exploit the functional programming features of Scala for great good!
  • Master testing to deploy allways the best code that you can create.
  • Not being scare when someone says things like "monadic computation", and use monads to dramatically improve the testability and modularity of your designs
  • Learn more functional programming yourself!

Outline

  • Introduction to Scala
    • Object-oriented programming
    • Functional programming
    • Implicits & generic programming
    • Build tools: sbt
    • Unit testing with Scalatest
  • Higher-order functions
    • Higher-order functions (HOFs)
    • HOFs in the Scala standard library
    • ADTs & catamorphisms
  • Higher-order functions (II)
    • Error handling with Either
    • Applicative programming with Validated
    • Asynchronous programming with Future
    • Dependency injection with Reader
  • Type classes
    • Type classes & object-oriented patterns
    • Type classes in the Scala standard library
    • Property-based testing

About the instructor

Alfonso Roa is a Functional Arquitect in Habla Computing. He has been using Scala for the last five years in real-world applications for the retail sector, and has extensive experience in consultancy projects with spark, akka and other frameworks of the Scala ecosystem. He is a co-organizer of the Madrid Scala Meetup group.

Terms of use

Welcome to the Habla Computing S.L. website
Owner: Habla Computing, S.L.
Address: Villalobos, 20, 13A 28018 Madrid
Tel. (+34) 91 172 68 52; fax. (+34) 91 172 68 52
E-mail: info@hablapps.com
Registry Data: Madrid Commerce Registry, Volume 27,693, Sheet 12, Section 8, Page M-499100, dated April 12, 2010, first registration.
C.I.F.: B-85933729

Terms of Use
The conditions herein regulate the use of this website. By accessing, browsing, or using this Web site imply that user have read, understood, and agree, unconditionally, to be bound by these terms.
Habla Computing may, without notice to you, at any time revise and/or update these Terms of Use and any other information contained in this Web site. Habla Computing may also make changes in the products, services, or programs described in this site at any time without previous notice.
Habla Computing reserves the right to deny, suspend, interrupt or cancel access or use of this website, either completely or partially, for those users or visitors found to be in non-compliance with any of the conditions set forth in this Legal Notice.

General
Specifically, the reproduction, transformation, distribution, communication, public dissemination and, in general, any form of development, using any procedure whatsoever, of all or part of the contents of this website, as well as any corresponding design and manner of presentation of the materials included herein are strictly prohibited. Said development shall only be permitted if Habla Computing issues written authorization of the same and only as long as appropriate reference is made to the sole property of Habla Computing. Notwithstanding the foregoing, any software and other materials that are made available for downloading, access, or other use from this site with their own license terms, conditions, and notices will be governed by such terms, conditions, and notices.
The decompilation, disassembly, reverse engineering, sub-licensing or transfer of any kind, translation or execution of work derived from the computer programs required for functioning, access and use of this website, and of the services described in the contents, as well as the execution of any of the development activities described in the previous paragraph, whether related to all or part of such programs, is also strictly prohibited. The user of this website must abstain from deleting, modifying, avoiding or manipulating any protection device or security systems that may be installed herein.
The brand names, commercial names and distinctive symbols are the sole property of Habla Computing. Access to the website does not imply the granting of any express or implied rights under any patents, trademarks, copyrights, or other proprietary or intellectual property rights.

Hyperlinks to other sites
The hyperlinks or links included in this website can lead the user to other third party sites, over which Habla Computing has no control. Habla Computing shall not be held liable for the contents or the state in which said sites are found. Access to the said sites using this website also does not, in any way whatsoever, imply that Habla Computing either recommends or approves of corresponding contents or use of such Web site.
Habla Computing is not a party to or responsible for any transactions user may enter into with third parties, even if you learn of such parties (or use a link to such parties) from a Habla Computing site. Accordingly, user acknowledge and agree that Habla Computing is not responsible for the availability of such external sites or resources, and is not responsible or liable for any content, services, products, or other materials on or available from those sites or resources.
It is up to user to take precautions to protect themselves from viruses, worms, trojan horses, and other potentially destructive programs, and to protect your information as you deem appropriate.

Linking to this site
All links to this Web site must be approved in writing by Habla Computing, except that Habla Computing consents to links in which the link and the pages that are activated by the link do not: (a) create frames around any page on this Web site or use other techniques that alter in any way the visual presentation or appearance of any content within this site; (b) misrepresent your relationship with Habla Computing; (c) imply that Habla Computing approves or endorses you, your Web site, or your service or product offerings; and (d) present false or misleading impressions about Habla Computing or otherwise damage the goodwill associated with the Habla Computing name. As a further condition to being permitted to link to this site, you agree that Habla Computing may at any time, in its sole discretion, terminate permission to link to this Web site. In such event, you agree to immediately remove all links to this Web site.

Modifications
Habla Computing reserves the right, at any time, to modify, enlarge or temporarily suspend the website presentation, configuration, technical specifications and services unilaterally and without previous notice.
Also reserves the right to modify the terms of use, as well as any other specific conditions, set forth herein at any time.

Confidential information
Habla Computing does not want to receive confidential or proprietary information from user through our Web site. Please note that any information or material sent to Habla Computing will be deemed NOT to be confidential. By sending Habla Computing any information or material, you grant Habla Computing an unrestricted, irrevocable license to copy, reproduce, publish, upload, post, transmit, distribute, publicly display, perform, modify, create derivative works from, and otherwise freely use, those materials or information. You also agree that Habla Computing is free to use any ideas, concepts, know-how, or techniques that you send us for any purpose. However, we will not release your name or otherwise publicize the fact that you submitted materials or other information to us unless we obtain your permission to use your name.

Liability Exclusion
Whoever uses the website does so at their own expense and risk. All materials, information, products, software, programs, and services are provided “as is” with no warranties or guarantees whatsoever, neither explicit nor implied, and can be modified or updated without previous notice. Habla Computing, its associates and employees shall not be held liable for the errors or omissions that could exist within the contents of either this website or other contents to which access can be gained using the same. Habla Computing, its associates and employees shall also not be held liable for either any damages arising from the use of this website or any activity undertaken as a result of the information made available herein. Accordingly, user should confirm the accuracy and completeness of all posted information before making any decision related to any services, products, or other matters described in this site.
Habla Computing does not guarantee the absence of viruses, worms or other harmful computer elements that could cause damage or alter the computer system in the electronic documents or user files included herein. As a result, Habla Computing shall not be held liable for any user or third party damages or losses arising from such elements. Furthermore, Habla Computing shall not be held liable for or guarantee the availability and continuity of access to this web site. Habla Computing shall also not guarantee that this website is secure or error-free. It shall be the user’s responsibility to have the appropriate tools available for detecting and disinfecting harmful or damaging computer programs.
In no event will Habla Computing be liable to any party for any direct, indirect, incidental, special, exemplary or consequential damages of any type whatsoever related to or arising from this web site or any use of this web site, or of any site or resource linked to, referenced, or accessed through this web site, or for the use or downloading of, or access to, any materials, information, products, or services, including, without limitation, any lost profits, business interruption, lost savings or loss of programs or other data. The user is fully aware of, and voluntarily accepts the fact that they are fully liable for any consequences arising from any use of any part of the contents herein, materials, information, products, software, programs, or services, so at their own discretion and risk. User will be solely responsible for any damages that may result, including loss of data or damage to your computer system.
The user shall be held liable for losses and damages of any kind that Habla Computing could suffer as a result of incompliance with the obligations set forth herein.
Additional or different terms, conditions, and notices may apply to specific materials, information, products, software, and services offered through this Web site. In the event of any conflict, such additional or different terms, conditions, and notices will prevail over these Terms of Use.

Legislation
Under any and all circumstances, the use conditions set forth herein shall be governed by Spanish Law.