Skip to content

Instantly share code, notes, and snippets.

@brendanzab
Forked from killballad/nest.rs
Last active December 22, 2015 13:38
Show Gist options
  • Save brendanzab/6480329 to your computer and use it in GitHub Desktop.
Save brendanzab/6480329 to your computer and use it in GitHub Desktop.
fn new_foo(a: &Path) -> Result<~Foo, ~str> {
read_whole_file(a).chain(|b| frob(b))
.chain(|b| baz(b))
.map_move(|b| ~Foo { bar: b })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment