News for hackers. Stuff that matters.
Re:Do notation considered harmful by jhomedall on Wednesday April 29, 2020 @10:43AM (#23019845)
IIRC that desugars to a >>= (\x -> b >>= (\y >>= return (f x y))) . I don't write Haskell, so that might be slightly off

This could be doing any one of:

- flatmapping over lists

- doing a computation with Maybe types, producing Nothing if a or b are nothing

- doing IO

- managing futures

- pretty much anything, actually

Don't confuse 'x <- a' with assignment, or 'return' with returning a value.

Another way of looking at it, (f x y) might be invoked:

- once

- never

- more than once

- later

There are no comments on this comment yet.