コード例 #1
0
 [PublicAPI] public static Either <Left, ImmutableList <To> > mapRightC <From, To, Left>(
     this Either <Left, ImmutableList <From> > e, Fn <From, To> mapper
     ) => mapRightC(e, mapper, _ => _.ToImmutableList());
コード例 #2
0
 public EitherEnumerator(Either <A, B> either) : this()
 {
     this.either = either;
 }
コード例 #3
0
 [PublicAPI] public static Either <ImmutableList <To>, Right> mapLeftC <From, To, Right>(
     this Either <ImmutableList <From>, Right> e, Fn <From, To> mapper
     ) => mapLeftC(e, mapper, _ => _.ToImmutableList());
コード例 #4
0
 [PublicAPI] public static Either <IEnumerable <ElemTo>, Right> mapLeftC <CollFrom, Right, ElemFrom, ElemTo>(
     this Either <CollFrom, Right> e,
     Fn <ElemFrom, ElemTo> mapper
     ) where CollFrom : IEnumerable <ElemFrom> =>
 e.mapLeft(mapC <CollFrom, ElemFrom, ElemTo>(mapper));
コード例 #5
0
 [PublicAPI] public static Either <Left, IEnumerable <ElemTo> > mapRightC <CollFrom, Left, ElemFrom, ElemTo>(
     this Either <Left, CollFrom> e,
     Fn <ElemFrom, ElemTo> mapper
     ) where CollFrom : IEnumerable <ElemFrom> =>
 e.mapRight(mapC <CollFrom, ElemFrom, ElemTo>(mapper));
コード例 #6
0
ファイル: Option.cs プロジェクト: Hengle/Tetris-1
 public Either <A, B> toLeft <B>(Fn <B> right)
 {
     return(isSome ? Either <A, B> .Left(value) : Either <A, B> .Right(right()));
 }
コード例 #7
0
 [PublicAPI] public static Either <A, B> flatten <A, B>(this Either <A, Either <A, B> > e) =>
 e.flatMapRight(_ => _);
コード例 #8
0
ファイル: Option.cs プロジェクト: JurgisRainys/tlplib
 [PublicAPI] public Either <B, A> toRight <B>(B left) =>
 isSome ? Either <B, A> .Right(__unsafeGetValue) : Either <B, A> .Left(left);
コード例 #9
0
ファイル: Option.cs プロジェクト: ArnasJ/tlplib
 public Either <A, B> toLeft <B>(Fn <B> right) =>
 isSome ? Either <A, B> .Left(__unsafeGetValue) : Either <A, B> .Right(right());
コード例 #10
0
 public static Either <L, R2> SelectMany <L, R, R1, R2>(
     this Either <L, R> opt, Fn <R, Either <L, R1> > f, Fn <R, R1, R2> g
     ) => opt.flatMapRight(f, g);
コード例 #11
0
ファイル: Option.cs プロジェクト: JurgisRainys/tlplib
 [PublicAPI] public Either <A, B> toLeft <B>(B right) =>
 isSome ? Either <A, B> .Left(__unsafeGetValue) : Either <A, B> .Right(right);
コード例 #12
0
 public static Either <L, R1> SelectMany <L, R, R1>(this Either <L, R> e, Fn <R, Either <L, R1> > f) =>
 e.flatMapRight(f);
コード例 #13
0
 public static Either <L, R1> Select <L, R, R1>(this Either <L, R> e, Fn <R, R1> f) =>
 e.mapRight(f);
コード例 #14
0
ファイル: Option.cs プロジェクト: Hengle/Tetris-1
 public Either <B, A> toRight <B>(Fn <B> left)
 {
     return(isSome ? Either <B, A> .Right(value) : Either <B, A> .Left(left()));
 }
コード例 #15
0
   [PublicAPI] public static Either <A, B> opt <A, B>(bool condition, A ifFalse, B ifTrue) =>
   condition
 ? Either <A, B> .Right(ifTrue)
 : Either <A, B> .Left(ifFalse);
コード例 #16
0
ファイル: Option.cs プロジェクト: ArnasJ/tlplib
 public Either <B, A> toRight <B>(Fn <B> left) =>
 isSome ? Either <B, A> .Right(__unsafeGetValue) : Either <B, A> .Left(left());
コード例 #17
0
   [PublicAPI] public static Either <A, B> opt <A, B>(bool condition, Fn <A> ifFalse, Fn <B> ifTrue) =>
   condition
 ? Either <A, B> .Right(ifTrue())
 : Either <A, B> .Left(ifFalse());
コード例 #18
0
ファイル: Either_Validation.cs プロジェクト: yika-aixi/tlplib
 public static Either <ImmutableList <A>, B> asValidation <A, B>(
     this Either <A, B> e1
     )
 {
     return(e1.mapLeft(ImmutableList.Create));
 }