News for hackers. Stuff that matters.
Re:Some thoughts on asynchronous Python API design in a post... by rkangel on Monday November 07, 2016 @10:00AM (#12891508)
> The IO monad and do-notation let you write sequential code

It's actually much subtler than that due to lazy evaluation. The 'palindrome' section of http://learnyouahaskell.com/input-and-output illustrates this.

You basically write code that says: read all input, split lines, do something per line, join result into multiline string, print.

If you did that in Python it would block until EOF on the input and then print the result. In Haskell, due to lazy evaluation you will interactively get the response on a per-line basis.

What Haskell really gives you is a declarative language to describe what you want to happen to some data and then the lazy evaluation sorts everything out. Underneath, it's effectively a load of callbacks processing data streams.

Re:Some thoughts on asynchronous Python API design in a post... by tome on Monday November 07, 2016 @11:42AM (#12892398)
Yeah but that's lazy IO, and is highly frowned on, even considered a historical mistake.