A :: operator that serves to start a NonEmptyList construction
expression.
A :: operator that serves to start a NonEmptyList construction
expression.
The result of calling this method will always be a NonEmptyList of length 1.
Here's an example:
scala> 1 :: End res0: org.scalactic.NonEmptyList[Int] = NonEmptyList(1)
Returns "End".
Returns "End".
Object that can be used as an endpoint for
NonEmptyListconstruction expressions that use the cons (::) operator.Here's an example:
Note that unlike
Nil, which is an instance ofList[Nothing],Endis not an instance ofNonEmptyList[Nothing], because there is no emptyNonEmptyList: