where the call to hSelect makes the process go to sleep
until there's input available on stdin.

Notice that this particular use of hSelect is now really a no-op
with GHC compiled code, as its implementation of IO will take care to
avoid blocking the process (i.e., all running Haskell threads), and
call select() for you, if needs be. However, hSelect exposes
functionality that is useful in other contexts (e.g., you want to
wait for input on two Handles for 3 seconds, but no longer.)