concept pure in category idris

appears as: pure
Type-Driven Development with Idris

This is an excerpt from Manning's book Type-Driven Development with Idris.

In a pure functional language, the following are also true:

The pure function is used to produce a value in an interactive program without having any other input or output effects when it’s executed. Its purpose is to allow pure values to be constructed by interactive programs, as shown by its type:

pure : a -> IO a

To understand the need for pure in readNumber, you can replace the then and else branches of the if with holes, and inspect their types: