Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

True, though in some cases you may want to write that one as:

    foo().and_then(bar).and_then(baz)
That becomes a bit more verbose, but it reads left-to-right, and works better if you want to use a closure as one of the functions. Which form looks more readable in a given circumstance may depend on the nature of foo, bar, and baz.


It has somewhat different semantics though, for instance with `?` all three functions can use different error types.


They have to be convertable though, because the function must have a single result code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: