Dealing with side effects

What should we do with input and output, networking, user input and user interfaces if they are necessary to avoid all forms of side effects? According to FP principles, these interactions with the real world are to be encapsulated inside special data structures. Even though the contained value or values remains unknown until runtime, these special data structures make it possible to map a function to one or more wrapped values (functor), to map a wrapped function to one or more wrapped values (applicative) or to map a wrapped function that returns an instance of its own data structure type to one or more wrapped values (monad). This way, side effects remain segregated from pure functions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset