You probably wrote half a monad by accident

from blog Andy G's Blog, | ↗ original
“I’ll compose a new type that holds a Doohickey and also indicates whether the fetch operation succeeded!” If you couldn’t have a utopia in the real world, then dammit you’d have one in your obscure codebase! It shall have clean logic untarnished by dirty, filthy hobbitses error-checking. Something like this: