3 ms·
I'm pretty sure this is isomorphic to Go's err, right? Report ~ res, err (well this bit not strictly, but in practice close enough) IFault ~ Err (interface ov
by akdor1154 2y ago
I'm pretty sure this is isomorphic to Go's err, right?
Report ~ res, err (well this bit not strictly, but in practice close enough)
IFault ~ Err (interface over a string repr, and a way to wrap a cause Err with err.Unwrap)
In my experience if you land on a design that looks like something either Go or F# does then you're probably on the right track. :)
- neonsunset 2y agoGo lets you ignore the errors and does not have tuples - only multi-variable returns so you can't not deconstruct the return value (and can't .map it as a result too). I don't think it's fair to place the two next to each other. F# also does exception handling (where it makes sense, though TryParse is more efficient): let values = ["abcd"; "1234"] let number = try int values[0] with _ -> 1337
- gf000 2y ago> In my experience if you land on a design that looks like something either Go or F# does then you're probably on the right track Well, let's just say that our experiences are vastly different then, but I had to do a double take when I saw Go mentioned as a positive from a PL design perspective.. And no, Go can literally return both a value and an error at the same time, it has possibly the worst error handling out of any "modern" language.