Summary

In this chapter we have covered the advantages and disadvantages of lazy I/O and its alternatives: strict I/O and some streaming solutions. We learned to connect to remote network endpoints as clients and to write own network servers in Haskell. We also learned that acquired I/O resources such as handles and sockets must always be freed. For this, we considered two main solutions: functions such as bracket and the ResourceT monad transformer.

After reading this chapter you should now understand and be able to use lazy I/O without surprising memory leaks and correctly release all acquired resources as well as exceptions. You know and can use three streaming libraries: rudimentary io-streams, elegant pipes, and industrial conduits. You are ...

Get Haskell High Performance Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.