public static MonadicValue <TInput> Do <TInput>(this MonadicValue <TInput> o, params Action <TInput>[] actions) { foreach (var action in actions) { action(o.Value); } return(o); }
public static MonadicValue <TInput> Map <TInput>(this MonadicValue <TInput> o, params Func <TInput, TInput>[] funcs) { var result = o; foreach (var func in funcs) { result = func(result); } return(result); }
public TypeMatcherContext(MonadicValue <TV> contextValue) { this.contextValue = contextValue; }
public static MonadicValue <TResult> Bind <TInput, TResult>(this MonadicValue <TInput> o, Func <TInput, MonadicValue <TResult> > f) => f(o.Value);
public static MaybeTypeMatcher <TV, T11> TypeMatch <TV, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this FuncState <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> s, MonadicValue <TV> value, Func <TypeMatcherContext <TV>, Func <Func <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, T11>, MaybeTypeMatcher <TV, T11> > f) => f(value.TypeMatch(), s.Func);
public static MaybeTypeMatcher <TV, T4> TypeMatch <TV, T1, T2, T3, T4>(this FuncState <T1, T2, T3, T4> s, MonadicValue <TV> value, Func <TypeMatcherContext <TV>, Func <Func <T1, T2, T3, T4>, T4>, MaybeTypeMatcher <TV, T4> > f) => f(value.TypeMatch(), s.Func);
public MatcherMemberAccessor(MonadicValue <TV> contextValue) : base(contextValue) { }
public static MonadicValue <TU> Match <TV, TU>(this MonadicValue <TV> v, TypeMatcher <TU> matcher) => matcher.Match(v.Value).ToM();
public static ListMatcherContext <TV> Match <TV>(this MonadicValue <TV[]> v) => new ListMatcherContext <TV>(v.With(x => x as IEnumerable <TV>));
public static IEnumerable <MonadicValue <T> > Lift <T>(this MonadicValue <IEnumerable <T> > v) => v.Value.Select(z => z.ToM());
public static MonadicValue <TInput> ApplyUnless <TInput>(this MonadicValue <TInput> o, Func <TInput, bool> evaluator, Func <TInput, TInput> action) => evaluator(o.Value) ? o : new Maybe <TInput>(action(o.Value));
public static MonadicValue <TInput> Do <TInput>(this MonadicValue <TInput> o, Action <TInput> action) { action(o.Value); return(o); }
public static MonadicValue <TResult> With <TInput, TResult>(this MonadicValue <TInput> o, Func <TInput, TResult> evaluator) => new MonadicValue <TResult>(evaluator(o.Value));
public static MatcherContext <TV> Match <TV>(this MonadicValue <TV> v) => new MatcherContext <TV>(v);
public static IEnumerable <MonadicValue <T> > Lift <T>(this MonadicValue <IEnumerable <MonadicValue <T> > > v) => v.Value;
public static ListMatcherContext <TV> Match <TV>(this MonadicValue <IEnumerable <TV> > v) => new ListMatcherContext <TV>(v);
public static MonadicValue <T> ToM <T>(this MonadicValue <T> value) => value;
public static TypeMatcherContext <TV> TypeMatch <TV>(this MonadicValue <TV> v) => new TypeMatcherContext <TV>(v);
public static MonadicValue <TU> Map <TV, TU>(this MonadicValue <TV> v, Func <MonadicValue <TV>, TU> mapFunc) => mapFunc(v).ToM();
public static Maybe <T> ToMaybe <T>(this MonadicValue <T> value) => new Maybe <T>(value.Value);
public Matcher() { contextValue = null; }
public static Matcher <TV, TU> Match <TV, TU, T1, T2, T3>(this FuncState <T1, T2, T3> s, MonadicValue <TV> value, Func <MatcherContext <TV>, Func <Func <T1, T2, T3>, T3>, Matcher <TV, TU> > f) => f(value.Match(), s.Func);
public Matcher(MonadicValue <TV> contextValue) { this.contextValue = contextValue; }
public static Matcher <TV, TU> Match <TV, TU, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this FuncState <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> s, MonadicValue <TV> value, Func <MatcherContext <TV>, Func <Func <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, T10>, Matcher <TV, TU> > f) => f(value.Match(), s.Func);
public static Result <T> Success <T>(MonadicValue <T> value) => new Result <T>(true, value.Value);
public ListMatcher(MonadicValue <IEnumerable <TV> > contextValue) : base(contextValue) { }
public PartiaMatcher(MonadicValue <TV> contextValue, Func <T1, TV, bool> func) : base(contextValue) { _func = func; }