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)); }
public MaybeEq(IEq <A> teq) { this.teq = teq; }
public NonEmptyLazyListEq(IEq <A> aeq) { this.aeq = aeq; }
public static IEqK <TryF> EqK(IEq <Exception> eqException) => new TryEqK(eqException);
public EqLaws(IEq <T> eq) => _eq = eq;
public bool EqK <T>(IKind <OptionF, T> x, IKind <OptionF, T> y, IEq <T> eq) => OptionK.Eq(eq).Eqv(x.Fix(), y.Fix());
public static bool LeftEq <X, A>(this Either <X, A> either, X other, IEq <X> xEq) { return(either.LeftTest(x => xEq.Eq(x, other))); }
public static bool JustEq <A>(this Maybe <A> maybe, A other, IEq <A> aEq) { return(maybe.JustTest(a => aEq.Eq(a, other))); }
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)); }
public ListEq(IEq <T> eq) => _eq = eq;
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());
public ResultEqK(IEq <TError> eqError) => _eqError = eqError;
public ResultEq(IEq <TOk> eqOk, IEq <TError> eqError) { _eqOk = eqOk; _eqError = eqError; }
public static IEqK <ResultOkF <TError> > EqK <TError>(IEq <TError> eqError) => new ResultEqK <TError>(eqError);
public static IEq <Result <TOk, TError> > Eq <TOk, TError>(IEq <TOk> eqOk, IEq <TError> eqError) => new ResultEq <TOk, TError>(eqOk, eqError);
public EitherEq(IEq <X> xeq, IEq <A> aeq) { this.xeq = xeq; this.aeq = aeq; }
public ValidationEq(IEq <X> xeq, IEq <A> aeq) { this.aeq = aeq; neq = NonEmptyLazyListEq.Create(xeq); }
public static bool Eq <A>(this Maybe <A> maybe, Maybe <A> other, IEq <A> tEq) { return(MaybeEq.Create(tEq).Eq(maybe, other)); }
public static bool RightEq <X, A>(this Either <X, A> either, A other, IEq <A> aEq) { return(either.RightTest(a => aEq.Eq(a, other))); }
public TryEq(IEq <T> eq, IEq <Exception> eqException) { _eq = eq; _eqException = eqException; }
public OptionEq(IEq <T> eq) => _eq = eq;
public TryEqK(IEq <Exception> eqException) => _eqException = eqException;
public static IEq <Option <T> > Eq <T>(IEq <T> eq) => new OptionEq <T>(eq);
public static IEq <Try <T> > Eq <T>(IEq <T> eq, IEq <Exception> eqException) => new TryEq <T>(eq, eqException);