From 6ea242522f1d61acdfd576b61315f868ad37afe5 Mon Sep 17 00:00:00 2001 From: JCranky Date: Thu, 5 Oct 2017 00:24:44 +0200 Subject: [PATCH] Add ::: to NonEmptyList --- core/src/main/scala/cats/data/NonEmptyList.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/scala/cats/data/NonEmptyList.scala b/core/src/main/scala/cats/data/NonEmptyList.scala index 875609c2368..c28fa9b8395 100644 --- a/core/src/main/scala/cats/data/NonEmptyList.scala +++ b/core/src/main/scala/cats/data/NonEmptyList.scala @@ -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 *