コード例 #1
0
ファイル: DigitTest.cs プロジェクト: 0xCM/Meta.Core
        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>();