How Monads are considered Pure?
问题 I am very much new to Haskell, and really impressed by the language's "architecture", but it still bothers me how monads can be pure. As you have any sequence of instructions, it makes it an impure function, especially functions with I/O wouldn't be pure from any point of view. Is it because Haskell assumes, like all pure functions, that IO function has a return value too, but in form of opcode or something? I am really confused. 回答1: One way to think of this is that a value of type IO a is a