O'Reilly logo

Learn You a Haskell for Great Good! by Miran Lipovaca

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 8. Input and Output

In this chapter, you’re going to learn how to receive input from the keyboard and print stuff to the screen.

But first, we’ll cover the basics of input and output (I/O):

  • What are I/O actions?

  • How do I/O actions enable us to do I/O?

  • When are I/O actions actually performed?

Dealing with I/O brings up the issue of constraints on how Haskell functions can work, so we’ll look at how we get around that first.

Separating the Pure from the Impure

By now, you’re used to the fact that Haskell is a purely functional language. Instead of giving the computer a series of steps to execute, you give it definitions of what certain things are. In addition, a function isn’t allowed to have side effects. A function can give us back only some ...

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