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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…