public override bool ValueOrCast <TMatched>(out T value, out Matched <TMatched> matched) { value = default; matched = noMatch <TMatched>(); return(false); }
public override bool ValueOrCast <TMatched>(out T value, out Matched <TMatched> matched) { value = default; matched = failedMatch <TMatched>(exception); return(false); }
public override bool ValueOrOriginal(out T value, out Matched <T> original) { value = default; original = this; return(false); }
public override Matched <TResult> Select <TResult>(Matched <T> result, Func <T, TResult> func) { return(failedMatch <TResult>(exception)); }
public override Matched <TResult> Select <TResult>(Matched <T> result, Func <T, TResult> func) => noMatch <TResult>();
public override bool EqualToValueOf(Matched <T> otherMatched) => false;
public override Matched <T> Or(Matched <T> other) => other;
public override bool Else <TOther>(out Matched <TOther> result) { result = failedMatch <TOther>(exception); return(true); }
void handle(Matched <T> match) { if (match.If(out var value, out var exception) && matched.If(out var action)) { action(value); }
public override bool Else <TOther>(out Matched <TOther> result) { result = noMatch <TOther>(); return(true); }
public abstract Matched <TResult> Select <TResult>(Matched <T> result, Func <T, TResult> func);
public MatchingContext(Matched <T> matched) => this.matched = matched;
public Matching(Matched <T> matched) { this.matched = matched; action = MonadFunctions.none <Func <TResult> >(); }
public abstract bool EqualToValueOf(Matched <T> otherMatched);
public abstract bool WasMatched(out Matched <T> matched);
public abstract bool Else <TOther>(out Matched <TOther> result);
public abstract bool ValueOrCast <TMatched>(out T value, out Matched <TMatched> matched);
public abstract bool ValueOrOriginal(out T value, out Matched <T> original);
public override bool WasMatched(out Matched <T> matched) { matched = this; return(false); }
public abstract Matched <T> Or(Matched <T> other);