haxetink/tink_core — pull request #1 by jasononeil (2013-11-05 00:56:20+00:00)
Title: Added OutcomeTools.flatMap

Any chance of adding this? I thought this was already in there, but it was not, only when working with futures / surprises.

I have code that I would like to look like:

return
findFile( '$repo/$path', Config.app.manual.extensions )
.flatMap( readFile )
.flatMap( toHtml );

where `findFile`, `readFile` and `toHtml` all return an Outcome with the same Failure type. It's nicer than `map` where each transformation function adds another layer of `Outcome<>` to be dealt with in the next transformation function.