O'Reilly logo

Get Programming with Haskell by Will Kurt

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

Lesson 24. Working with files

After reading lesson 24, you’ll be able to

  • Work with file handles in Haskell
  • Read from and write to files
  • Understand limitations of lazy evaluation for I/O

One of the most important uses of I/O is to read and write from files. So far in this unit, you’ve learned a bit of the syntax behind IO types in Haskell, saw how to build command-line programs using lazy evaluation, and learned about efficient text processing by using the Text type. Now you’ll look at working with files, including how they can make using lazy I/O a bit tricky. You’ll start with the basics of opening, closing, reading from, and writing to simple files. Then you’ll write a program that takes various statistics from an input file (including ...

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