FromUnion <T1, T2, T3, T4, T5, T6, T7>( IUnion <T1, T2, T3, T4, T5, T6, T7> union) where T1 : notnull where T2 : notnull where T3 : notnull where T4 : notnull where T5 : notnull where T6 : notnull where T7 : notnull { if (union is AnyOf <T1, T2, T3, T4, T5, T6, T7> anyOf) { return(anyOf); } else { return(union.Match <AnyOf <T1, T2, T3, T4, T5, T6, T7> >( v1 => v1, v2 => v2, v3 => v3, v4 => v4, v5 => v5, v6 => v6, v7 => v7)); } }
FromUnion <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>( IUnion <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> union) where T1 : notnull where T2 : notnull where T3 : notnull where T4 : notnull where T5 : notnull where T6 : notnull where T7 : notnull where T8 : notnull where T9 : notnull where T10 : notnull where T11 : notnull { if (union is AnyOf <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> anyOf) { return(anyOf); } else { return(union.Match <AnyOf <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> >( v1 => v1, v2 => v2, v3 => v3, v4 => v4, v5 => v5, v6 => v6, v7 => v7, v8 => v8, v9 => v9, v10 => v10, v11 => v11)); } }
public F Fmap <T1>(Func <TRight, T1> f) where T1 : class { return(_union .Match( (l) => new Factory <F, TLeft>(l).Instance(), (r) => new Factory <F, T1>(f(r)).Instance() )); }
public M1 Bind <M1, T1>(Func <TRight, TMonad <T1> .THead <TLeft> .IParent <M1> > m) where M1 : TMonad <T1> .THead <TLeft> .IParent <M1> where T1 : class { return(_union .Match( (l) => new Factory <M1, TLeft>(l).Instance(), (r) => (M1)m(r) )); }
public A Apply <T2>(IUnion <TLeft, IFunc <TRight, T2> > app) where T2 : class { return(app.Match( (l) => new Factory <A, TLeft>(l).Instance(), (r) => _functor .Match( (ll) => new Factory <A, TLeft>(ll).Instance(), (rr) => new Factory <A, T2>(r.Run(rr)).Instance() ) )); }
FromUnion <T1, T2, T3>( IUnion <T1, T2, T3> union) where T1 : notnull where T2 : notnull where T3 : notnull { if (union is AnyOf <T1, T2, T3> anyOf) { return(anyOf); } else { return(union.Match <AnyOf <T1, T2, T3> >( v1 => v1, v2 => v2, v3 => v3)); } }
FromUnion <T1, T2, T3, T4, T5>( IUnion <T1, T2, T3, T4, T5> union) where T1 : notnull where T2 : notnull where T3 : notnull where T4 : notnull where T5 : notnull { if (union is AnyOf <T1, T2, T3, T4, T5> anyOf) { return(anyOf); } else { return(union.Match <AnyOf <T1, T2, T3, T4, T5> >( v1 => v1, v2 => v2, v3 => v3, v4 => v4, v5 => v5)); } }
public TResult Match <TResult>(Func <TLeft, TResult> f0, Func <TRight, TResult> f1) { return(_union.Match(f0, f1)); }