Python-based monads essay part 2
Marko Rauhamaa
marko at pacujo.net
Tue Oct 18 06:45:48 EDT 2016
Chris Angelico <rosuav at gmail.com>:
> I think, it is patently false to claim that Haskell is purely
> functional - but the I/O monads are a crucial feature in making the
> language useful.
As soon as you accept that values can exist in "a superposition," that
is, in a not-yet-fully-materialized form, you can see that functionality
is not broken.
Similarly you can imagine a function that returns the exact decimal
representation of π; the function returns its value, which is printed on
your screen by the REPL. Digits start whizzing by well before the
function has completed its computation.
No side effects needed, but digit ordering is, of course, crucial.
Marko
More information about the Python-list
mailing list