コード例 #1
0
 public T Single()
 {
     if (Rest.Any())
     {
         throw new Exception("Enumerable1 assumption for Single() failed - REST element was non-empty");
     }
     return(First);
 }
コード例 #2
0
 public T Single()
 {
     if (Rest.Any())
     {
         throw new Exception("Array1 assumption for Single() failed - the length was actually " + Length);
     }
     return(First);
 }
コード例 #3
0
 public bool Any(Func <T, bool> f) => f(First) || Rest.Any(f);
コード例 #4
0
 public T Last() => Rest.Any() ? Rest.Last() : First;