4 ms·
Yeah, but that doesn't extend to match { let f = fopen(); fwrite("aha", f); fclose(f); } { Err(e) => println("either of fopen, fwrite or fclose fai
by ben0x539 12y ago
Yeah, but that doesn't extend to
match { let f = fopen(); fwrite("aha", f); fclose(f); } {
Err(e) => println("either of fopen, fwrite or fclose failed"),
_ => ()
}
without something like a try! variant that breaks out of a block instead of returning from a function on error.
- vampirebat 12y agoThis is exactly what the Error / Either monad does.
- ben0x539 12y agoCan't be, it does IO!