コード例 #1
0
ファイル: Either.cs プロジェクト: pocketberserker/xsharpx
 public static Pair <Either <X, A>, Either <X, B> > Unzip <X, A, B>(this Either <X, Pair <A, B> > p)
 {
     return(p.Select(q => q._1.Get).And(p.Select(q => q._2.Get)));
 }
コード例 #2
0
ファイル: Either.cs プロジェクト: pocketberserker/xsharpx
 public Either <A, D> ZipWith <C, D>(Either <A, C> o, Func <B, Func <C, D> > f)
 {
     return(this.SelectMany(a => o.Select(b => f(a)(b))));
 }
コード例 #3
0
ファイル: Either.cs プロジェクト: pocketberserker/xsharpx
 public static Either <X, B> Apply <X, A, B>(this Either <X, Func <A, B> > f, Either <X, A> o)
 {
     return(f.SelectMany(g => o.Select(p => g(p))));
 }