O'Reilly logo

Functional Programming in Java: How functional techniques improve your Java programs by Pierre-Yves Saumont

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Functional input/output

This chapter covers

  • Applying effects safely from inside contexts
  • Adding effect application to Result and List
  • Combining effects for successes and failures
  • Reading data safely from the console, from file, or from memory, with the Reader abstraction
  • Handling input/output with the IO type

So far, you’ve learned how to write functional programs that haven’t really produced any usable results. You learned how to compose true functions to build more-powerful functions. More interestingly, you learned how to use nonfunctional operations in a safe, functional way. Nonfunctional operations are operations producing side effects, like throwing exceptions, changing the outside world, or simply depending on the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required