On Wed, Jun 10, 2015 at 11:15 AM Marcin Mrotek <marcin.jan.mrotek@gmail.com> wrote:
That's why, this is not a pure function because every time you call it, it may return a different string.

This is a common source of confusion. A value of type IO a for some a is not an impure function because it is not a function. Its evaluation is completely pure and referentially transparent: every time you evaluate `getLine`, you get the same IO String value. The only observable difference is under execution, but we don't expect execution to be pure: we only expect evaluation to be pure.