Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering Functional Programming

You're reading from   Mastering Functional Programming Functional techniques for sequential and parallel programming with Scala

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781788620796
Length 380 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (23) Chapters Close

Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
1. The Declarative Programming Style FREE CHAPTER 2. Functions and Lambdas 3. Functional Data Structures 4. The Problem of Side Effects 5. Effect Types - Abstracting Away Side Effects 6. Effect Types in Practice 7. The Idea of the Type Classes 8. Basic Type Classes and Their Usage 9. Libraries for Pure Functional Programming 10. Patterns of Advanced Functional Programming 11. Introduction to the Actor Model 12. The Actor Model in Practice 13. Use Case - A Parallel Web Crawler 1. Introduction to Scala 2. Assessments 3. Other Books You May Enjoy Index

Chapter 6


  1. Asynchronous computations.
  2. Try represents the erroneous case as an exception. Exceptions may not always be desirable in a functional context since they make sense only when we want to throw them. Functional programming discourages throwing exceptions since they are side effects. Hence, we have a more general type called Either that is capable of representing an alternative between any two values.
  3. One way of representing dependency injection in functional programming is via the Reader type. It is an abstraction of the fact that a computation depends on some value and cannot be executed without it. Reader is basically a function. However, it has a more concise signature, and the concept of continuation with flatmap is applied to it the same way as to any other effect type.
  4. Flatmap allows you to sequentially compose side-effecting computations that use effect types to represent side effects.

 

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images