Skip to content

Commit

Permalink
Add ::: to NonEmptyList
Browse files Browse the repository at this point in the history
  • Loading branch information
jcranky committed Oct 4, 2017
1 parent c131fe4 commit 6ea2425
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/main/scala/cats/data/NonEmptyList.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ final case class NonEmptyList[+A](head: A, tail: List[A]) {
def ::[AA >: A](a: AA): NonEmptyList[AA] =
NonEmptyList(a, head :: tail)

def :::[AA >: A](other: NonEmptyList[AA]): NonEmptyList[AA] =
other.concat(this)

/**
* Remove elements not matching the predicate
*
Expand Down

0 comments on commit 6ea2425

Please sign in to comment.