Exercises in programming style: FP & I/O

Click for: original source

The article in which author explores one of the foundation of Functional Programming, I/O and how to cope with it. Written by Nicolas Fränkel a developer advocate with 15+ years experience consulting for many different customers.

The content of the article:

  • Purity, side-effects, and I/O
  • Applying the theory
  • Higher-Order functions: purity and laziness
  • Handling different function signatures

Purity is one of the foundations of FP. Side-effects in general, and I/O in particular, breaks purity. A straightforward way to cope with I/O is to wrap functions into other functions to create higher-order functions.

Even better, higher-order functions provide laziness, and all their associated benefits. The complete source code for this post can be found on Github. Good read!

[Read More]

Tags nodejs programming software functional-programming