示例#1
0
        public EqLawsTests(IEq <T> eq)
        {
            var eqLaws = new EqLaws <T>(eq);

            Add("Reflexivity", eqLaws.Reflexivity);
            Add("Symmetry", x => eqLaws.Symmetry(x, x));
            Add("Substitution", x => eqLaws.Substitution(x, x, Combinators.I));
            Add("Transitivity", x => eqLaws.Transitivity(x, x, x));
        }
示例#2
0
 public MaybeEq(IEq <A> teq)
 {
     this.teq = teq;
 }
示例#3
0
 public NonEmptyLazyListEq(IEq <A> aeq)
 {
     this.aeq = aeq;
 }
示例#4
0
 public static IEqK <TryF> EqK(IEq <Exception> eqException) => new TryEqK(eqException);
示例#5
0
 public EqLaws(IEq <T> eq) => _eq = eq;
示例#6
0
 public bool EqK <T>(IKind <OptionF, T> x, IKind <OptionF, T> y, IEq <T> eq) =>
 OptionK.Eq(eq).Eqv(x.Fix(), y.Fix());
示例#7
0
文件: Predicates.cs 项目: jedahu/Jib
 public static bool LeftEq <X, A>(this Either <X, A> either, X other, IEq <X> xEq)
 {
     return(either.LeftTest(x => xEq.Eq(x, other)));
 }
示例#8
0
文件: Predicates.cs 项目: jedahu/Jib
 public static bool JustEq <A>(this Maybe <A> maybe, A other, IEq <A> aEq)
 {
     return(maybe.JustTest(a => aEq.Eq(a, other)));
 }
示例#9
0
 public static bool Eq <X, A>(this Either <X, A> either, Either <X, A> other, IEq <X> xeq, IEq <A> aeq)
 {
     return(EitherEq.Create(xeq, aeq).Eq(either, other));
 }
示例#10
0
 public ListEq(IEq <T> eq) => _eq = eq;
示例#11
0
 public bool EqK <TOk, TError>(
     IKind2 <ResultF, TOk, TError> x, IKind2 <ResultF, TOk, TError> y, IEq <TOk> eqOk, IEq <TError> eqError) =>
 ResultK.Eq(eqOk, eqError).Eqv(x.Fix(), y.Fix());
示例#12
0
 public ResultEqK(IEq <TError> eqError) => _eqError = eqError;
示例#13
0
 public ResultEq(IEq <TOk> eqOk, IEq <TError> eqError)
 {
     _eqOk    = eqOk;
     _eqError = eqError;
 }
示例#14
0
 public static IEqK <ResultOkF <TError> > EqK <TError>(IEq <TError> eqError) => new ResultEqK <TError>(eqError);
示例#15
0
 public static IEq <Result <TOk, TError> > Eq <TOk, TError>(IEq <TOk> eqOk, IEq <TError> eqError) =>
 new ResultEq <TOk, TError>(eqOk, eqError);
示例#16
0
 public EitherEq(IEq <X> xeq, IEq <A> aeq)
 {
     this.xeq = xeq;
     this.aeq = aeq;
 }
示例#17
0
 public ValidationEq(IEq <X> xeq, IEq <A> aeq)
 {
     this.aeq = aeq;
     neq      = NonEmptyLazyListEq.Create(xeq);
 }
示例#18
0
 public static bool Eq <A>(this Maybe <A> maybe, Maybe <A> other, IEq <A> tEq)
 {
     return(MaybeEq.Create(tEq).Eq(maybe, other));
 }
示例#19
0
文件: Predicates.cs 项目: jedahu/Jib
 public static bool RightEq <X, A>(this Either <X, A> either, A other, IEq <A> aEq)
 {
     return(either.RightTest(a => aEq.Eq(a, other)));
 }
示例#20
0
 public TryEq(IEq <T> eq, IEq <Exception> eqException)
 {
     _eq          = eq;
     _eqException = eqException;
 }
示例#21
0
 public OptionEq(IEq <T> eq) => _eq = eq;
示例#22
0
 public TryEqK(IEq <Exception> eqException) => _eqException = eqException;
示例#23
0
 public static IEq <Option <T> > Eq <T>(IEq <T> eq) => new OptionEq <T>(eq);
示例#24
0
 public static IEq <Try <T> > Eq <T>(IEq <T> eq, IEq <Exception> eqException) => new TryEq <T>(eq, eqException);