Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 928 Bytes

fp-intro.md

File metadata and controls

25 lines (18 loc) · 928 Bytes
title type description num previous-page next-page
Functional Programming
chapter
This chapter provides an introduction to functional programming in Scala 3.
41
collections-summary
fp-what-is-fp

Scala lets you write code in an object-oriented programming (OOP) style, a functional programming (FP) style, and also in a hybrid style---using both approaches in combination. As Martin Odersky has stated, the essence of Scala is a fusion of functional and object-oriented programming in a typed setting:

  • Functions for the logic
  • Objects for the modularity

This chapter assumes that you’re comfortable with OOP and less comfortable with FP, so it provides a gentle introduction to several main functional programming concepts:

  • What is functional programming?
  • Immutable values
  • Pure functions
  • Functions are values
  • Functional error handling