Ejemplo n.º 1
0
 public static Task Apply <TUnionType, TUnionDefinition, TOne, TTwo, TThree>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree> > > union, Action <TOne> one, Action <TTwo> two, Action <TThree> three)
     where TUnionType : struct
     where TUnionDefinition : notnull, UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree>
     where TOne : notnull
     where TTwo : notnull
     where TThree : notnull
 => union.Do(one, two, three);
Ejemplo n.º 2
0
 public static async Task <TResult> MatchAsync <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight, TResult>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> > > union, Func <TOne, Task <TResult> > one, Func <TTwo, Task <TResult> > two, Func <TThree, Task <TResult> > three, Func <TFour, Task <TResult> > four, Func <TFive, Task <TResult> > five, Func <TSix, Task <TResult> > six, Func <TSeven, Task <TResult> > seven, Func <TEight, Task <TResult> > eight)
     where TUnionType : struct
     where TUnionDefinition : notnull, UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>
     where TOne : notnull
     where TTwo : notnull
     where TThree : notnull
     where TFour : notnull
     where TFive : notnull
     where TSix : notnull
     where TSeven : notnull
     where TEight : notnull
 => await(await union).Match(one, two, three, four, five, six, seven, eight);
Ejemplo n.º 3
0
 public static async Task <TUnionType> DoAsync <TUnionType, TUnionDefinition, TOne, TTwo, TThree>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree> > > union, Func <TOne, Task> one, Func <TTwo, Task> two, Func <TThree, Task> three)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree>
 => await(await union).DoAsync(one, two, three);
Ejemplo n.º 4
0
 public static async Task ApplyAsync <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive> > > union, Func <TOne, Task> one, Func <TTwo, Task> two, Func <TThree, Task> three, Func <TFour, Task> four, Func <TFive, Task> five)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive>
 => await(await union).ApplyAsync(one, two, three, four, five);
Ejemplo n.º 5
0
 public static Task <Option <TThree> > Three <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour> > > union)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour>
 => union.Match(_ => Option.None <TThree>(), _ => Option.None <TThree>(), Option.Some, _ => Option.None <TThree>());
Ejemplo n.º 6
0
 public static Task <Option <TTwo> > Two <TUnionType, TUnionDefinition, TOne, TTwo>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo> > > union)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo>
 => union.Match(_ => Option.None <TTwo>(), Option.Some);
        public static async Task <UnionPartition <TOne, TTwo, TThree, TFour> > Partition <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour>(this IUnionTask <IEnumerable <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour> > > > source)
            where TUnionType : struct
            where TUnionDefinition : notnull, UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour>
            where TOne : notnull
            where TTwo : notnull
            where TThree : notnull
            where TFour : notnull
        {
            var values = new ReplayableEnumerable <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour> > >(await source);

            return(new UnionPartition <TOne, TTwo, TThree, TFour>
                   (
                       values.WhereOne(),
                       values.WhereTwo(),
                       values.WhereThree(),
                       values.WhereFour()
                   ));
        }
Ejemplo n.º 8
0
 public static async Task <TResult> MatchAsync <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TResult>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven> > > union, Func <TOne, Task <TResult> > one, Func <TTwo, Task <TResult> > two, Func <TThree, Task <TResult> > three, Func <TFour, Task <TResult> > four, Func <TFive, Task <TResult> > five, Func <TSix, Task <TResult> > six, Func <TSeven, Task <TResult> > seven)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven>
 => await(await union).Match(one, two, three, four, five, six, seven);
Ejemplo n.º 9
0
 public static Task Apply <TUnionType, TUnionDefinition, TOne>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne> > > union, Action <TOne> one)
     where TUnionType : struct
     where TUnionDefinition : notnull, UnionDefinitionBase <TUnionType, TUnionDefinition, TOne>
     where TOne : notnull
 => union.Do(one);
Ejemplo n.º 10
0
 public static async Task <TUnionType> Do <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive> > > union, Action <TOne> one, Action <TTwo> two, Action <TThree> three, Action <TFour> four, Action <TFive> five)
     where TUnionType : struct
     where TUnionDefinition : notnull, UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive>
     where TOne : notnull
     where TTwo : notnull
     where TThree : notnull
     where TFour : notnull
     where TFive : notnull
 => (await union).Do(one, two, three, four, five);
Ejemplo n.º 11
0
 public static async Task <TUnionType> Do <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> > > union, Action <TOne> one, Action <TTwo> two, Action <TThree> three, Action <TFour> four, Action <TFive> five, Action <TSix> six, Action <TSeven> seven, Action <TEight> eight)
     where TUnionType : struct
     where TUnionDefinition : notnull, UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>
     where TOne : notnull
     where TTwo : notnull
     where TThree : notnull
     where TFour : notnull
     where TFive : notnull
     where TSix : notnull
     where TSeven : notnull
     where TEight : notnull
 => (await union).Do(one, two, three, four, five, six, seven, eight);
Ejemplo n.º 12
0
 public static async Task <TUnionType> AsUnion <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> > > union)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>
 => ((UnionValue <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>) await union).GetUnion();
Ejemplo n.º 13
0
 public static async Task <TUnionType> AsUnion <TUnionType, TUnionDefinition, TOne, TTwo, TThree>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree> > > union)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree>
 => ((UnionValue <TUnionType, TUnionDefinition, TOne, TTwo, TThree>) await union).GetUnion();
Ejemplo n.º 14
0
 public static async Task <TUnionType> AsUnion <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive> > > union)
     where TUnionType : struct
     where TUnionDefinition : notnull, UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive>
     where TOne : notnull
     where TTwo : notnull
     where TThree : notnull
     where TFour : notnull
     where TFive : notnull
 => ((UnionValue <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive>) await union).GetUnion();
Ejemplo n.º 15
0
 public static async Task <TResult> Match <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TResult>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive> > > union, Func <TOne, TResult> one, Func <TTwo, TResult> two, Func <TThree, TResult> three, Func <TFour, TResult> four, Func <TFive, TResult> five)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive>
 => (await union).Match(one, two, three, four, five);
Ejemplo n.º 16
0
 public static Task Apply <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven> > > union, Action <TOne> one, Action <TTwo> two, Action <TThree> three, Action <TFour> four, Action <TFive> five, Action <TSix> six, Action <TSeven> seven)
     where TUnionType : struct
     where TUnionDefinition : notnull, UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven>
     where TOne : notnull
     where TTwo : notnull
     where TThree : notnull
     where TFour : notnull
     where TFive : notnull
     where TSix : notnull
     where TSeven : notnull
 => union.Do(one, two, three, four, five, six, seven);
Ejemplo n.º 17
0
 public static async Task <TResult> MatchAsync <TUnionType, TUnionDefinition, TOne, TResult>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne> > > union, Func <TOne, Task <TResult> > one)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne>
 => await(await union).Match(one);
Ejemplo n.º 18
0
 public static async Task <TUnionType> Do <TUnionType, TUnionDefinition, TOne, TTwo>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo> > > union, Action <TOne> one, Action <TTwo> two)
     where TUnionType : struct
     where TUnionDefinition : notnull, UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo>
     where TOne : notnull
     where TTwo : notnull
 => (await union).Do(one, two);
Ejemplo n.º 19
0
 public static async Task <TResult> Match <TUnionType, TUnionDefinition, TOne, TTwo, TResult>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo> > > union, Func <TOne, TResult> one, Func <TTwo, TResult> two)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo>
 => (await union).Match(one, two);
Ejemplo n.º 20
0
 public static async Task <TUnionType> Do <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven> > > union, Action <TOne> one, Action <TTwo> two, Action <TThree> three, Action <TFour> four, Action <TFive> five, Action <TSix> six, Action <TSeven> seven)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven>
 => (await union).Do(one, two, three, four, five, six, seven);
Ejemplo n.º 21
0
 public static Task <Option <TOne> > One <TUnionType, TUnionDefinition, TOne>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne> > > union)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne>
 => union.Match(Option.Some);
Ejemplo n.º 22
0
 public static Task Apply <TUnionType, TUnionDefinition, TOne, TTwo>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo> > > union, Action <TOne> one, Action <TTwo> two)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo>
 => union.Do(one, two);
Ejemplo n.º 23
0
 public static Task <Option <TEight> > Eight <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> > > union)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>
 => union.Match(_ => Option.None <TEight>(), _ => Option.None <TEight>(), _ => Option.None <TEight>(), _ => Option.None <TEight>(), _ => Option.None <TEight>(), _ => Option.None <TEight>(), _ => Option.None <TEight>(), Option.Some);
Ejemplo n.º 24
0
 public static Task Apply <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive> > > union, Action <TOne> one, Action <TTwo> two, Action <TThree> three, Action <TFour> four, Action <TFive> five)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive>
 => union.Do(one, two, three, four, five);
Ejemplo n.º 25
0
 public static async Task ApplyAsync <TUnionType, TUnionDefinition, TOne, TTwo>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo> > > union, Func <TOne, Task> one, Func <TTwo, Task> two)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo>
 => await(await union).ApplyAsync(one, two);
Ejemplo n.º 26
0
 public static Task Apply <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> > > union, Action <TOne> one, Action <TTwo> two, Action <TThree> three, Action <TFour> four, Action <TFive> five, Action <TSix> six, Action <TSeven> seven, Action <TEight> eight)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>
 => union.Do(one, two, three, four, five, six, seven, eight);
Ejemplo n.º 27
0
 public static async Task ApplyAsync <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight> > > union, Func <TOne, Task> one, Func <TTwo, Task> two, Func <TThree, Task> three, Func <TFour, Task> four, Func <TFive, Task> five, Func <TSix, Task> six, Func <TSeven, Task> seven, Func <TEight, Task> eight)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix, TSeven, TEight>
 => await(await union).ApplyAsync(one, two, three, four, five, six, seven, eight);
Ejemplo n.º 28
0
 public static async Task <TUnionType> Do <TUnionType, TUnionDefinition, TOne, TTwo, TThree>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree> > > union, Action <TOne> one, Action <TTwo> two, Action <TThree> three)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree>
 => (await union).Do(one, two, three);
Ejemplo n.º 29
0
 public static async Task <TUnionType> DoAsync <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix> > > union, Func <TOne, Task> one, Func <TTwo, Task> two, Func <TThree, Task> three, Func <TFour, Task> four, Func <TFive, Task> five, Func <TSix, Task> six)
     where TUnionType : struct
     where TUnionDefinition : UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TSix>
 => await(await union).DoAsync(one, two, three, four, five, six);
Ejemplo n.º 30
0
 public static async Task <TResult> MatchAsync <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive, TResult>(this IUnionTask <IUnionValue <UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive> > > union, Func <TOne, Task <TResult> > one, Func <TTwo, Task <TResult> > two, Func <TThree, Task <TResult> > three, Func <TFour, Task <TResult> > four, Func <TFive, Task <TResult> > five)
     where TUnionType : struct
     where TUnionDefinition : notnull, UnionDefinitionBase <TUnionType, TUnionDefinition, TOne, TTwo, TThree, TFour, TFive>
     where TOne : notnull
     where TTwo : notnull
     where TThree : notnull
     where TFour : notnull
     where TFive : notnull
 => await(await union).Match(one, two, three, four, five);