Hacker News new | ask | show | jobs
by joeyh 5325 days ago
The problem with the simplification is that you really need to understand which monad code is using to read the code. foo >>= bar >>= baz has very different behaviors in the IO monad (it's like a shell pipe foo | bar | baz) and the Maybe monad (it's like a short-circuiting foo && bar && baz).
1 comments

Not really... you're perfectly capable of reading Python code:

  x = foo()
  y = bar(x)
  baz(y)
Knowing that any of these functions could throw an exception. How is it any different, from the reader's perspective? (Yes, it's /very/ different from an implementation perspective, but that's not what we're dealing with here...)