Skip to Content
Mastering JavaScript Functional Programming - Second Edition
book

Mastering JavaScript Functional Programming - Second Edition

by Federico Kereki
January 2020
Intermediate to advanced
470 pages
11h 13m
English
Packt Publishing
Content preview from Mastering JavaScript Functional Programming - Second Edition

Containers and functors

What we did in the previous section does work and can be used with no problems. However, we would like to consider a more general solution that we can apply to any data type. Since not all things in JavaScript provide the desired map() method, we will have to either extend the type (as we did in the previous section) or apply a design pattern that we considered in Chapter 11, Implementing Design Patterns  The Functional Way: wrapping our data types with a wrapper that will provide the required map() operations. 

In particular, we will do the following:

  • Start by seeing how to build a basic container, wrapping a value 
  • Convert the container into something more powerful—a functor 
  • Study how to deal with missing values ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering JavaScript Functional Programming

Mastering JavaScript Functional Programming

Federico Kereki

Publisher Resources

ISBN: 9781839213069Supplemental Content