コード例 #1
0
 /**
  * Appends (snoc) the given element to this non empty list to produce a new non empty list. O(n).
  *
  * @param a The element to append to this non empty list.
  * @return A new non empty list with the given element appended.
  */
 public NonEmptyList<A> snoc(final A a) {
   return nel(head, tail.snoc(a));
 }