Get the latest tech news
Fault Report – and alternative to Result in F#
Thoughts on software development and sundry other topics
If the caller wanted to programmatically “react” in some smarter way, they don't really have any additional information with which to work (unless they start trying to carve the error string... but that's a quick trip to the land of madness). In order to enforce it, we need to rethink our discriminated union slightly ( pay close attention to the generic constraints-- it's really the linchpin of the whole approach): Now, in practice, this approach would also benefit from many more supporting functions ( bind, bindFault, et cetera), a few additional commonly-wanted type definitions (eg: Demotion, CompoundFault), and possibly even a computation expression.
Or read this on Hacker News