Книга: Functional Programming in JavaScript
Назад: Summary
Дальше: Partial function application and currying

Chapter 4. Implementing Functional Programming Techniques in JavaScript

Hold on to your hats because we're really going to get into the functional mind-set now.

In this chapter, we're going to do the following:

  • Put all the core concepts together into a cohesive paradigm
  • Explore the beauty that functional programming has to offer when we fully commit to the style
  • Step through the logical progression of functional patterns as they build upon each other
  • All the while, we will build up a simple application that does some pretty cool stuff

You may have noticed a few concepts that were brought up in the last chapter when dealing with functional libraries for JavaScript, but not in , Fundamentals of Functional Programming. Well, that was for a reason! Compositions, currying, partial application, and more. Let's explore why and how these libraries implemented those concepts.

Functional programming can come in a variety of flavors and patterns. This chapter will cover many different styles of functional programming:

  • Data generic programming
  • Mostly functional programming
  • Functional reactive programming and more

This chapter, however, will be as style-unbiased as possible. Without leaning too hard on one style of functional programming over another, the overall goal is to show that there are better ways to write code than what is often accepted as the correct and only way. Once you free your mind about the preconceptions of what is the right way and what is not the right way to write code, you can do whatever you want. When you just write code with childlike abandon for no reason other than the fact that you like it and when you're not concerned about conforming to the traditional way of doing things, then the possibilities are endless.

Назад: Summary
Дальше: Partial function application and currying

bsn
thank
Vesa Karvonen
I hope you don't mind, but I’d like to point you and your readers to my high-performance optics library for JavaScript that is in production use in multiple projects, has comprehensive support for partial optics and interactive documentation: https://calmm-js.github.io/partial.lenses/ (this takes a moment to load — be patient!)