Пример #1
0
        public void Test01()
        {
            var d1 = Digit.Define(3);
            var wf = from eq in some(Eq.make <Digit>())
                     let result = eq.eq(d1, Digit.Define(3))
                                  select result ? "good" : "bad";

            claim.satisfies(wf, result => result == "good");
        }
Пример #2
0
 /// <summary>
 /// Returns true if two values are equal, false otherwise
 /// </summary>
 /// <typeparam name="X">The value type</typeparam>
 /// <param name="x1">The first value</param>
 /// <param name="x2">The second value</param>
 /// <returns></returns>
 public static bool eq <X>(X x1, X x2)
 => Eq.make <X>().eq(x1, x2);
Пример #3
0
 /// <summary>
 /// Retrieves an identified <see cref="IEq"/> instance
 /// </summary>
 /// <typeparam name="X">The type over which an equality is constructed</typeparam>
 /// <returns></returns>
 public static IEq <X> equality <X>()
 => Eq.make <X>();