3 ms·
I've actually switched to using a Reply<T> for anything which models the TrySomething pattern. So it looks like: var possibleInt = TryParse(s); if(!possib
by AndrewDucker 13y ago
I've actually switched to using a Reply<T> for anything which models the TrySomething pattern.
So it looks like:
var possibleInt = TryParse(s);
if(!possibleInt.Success)
{
//Fail out early
}
var actualInt= possibleInt.Data;
(Our Reply objects also allow for messages to be passed up, so that various layers can report details of the error they bumped into, and the presentation layer can then display them.)
- louthy 13y agoLooks like you're part of your way to implementing the Error or Either monad.