Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! Stop old #:: from being c…
Browse files Browse the repository at this point in the history
…alled

examples and fix mistake
  • Loading branch information
NthPortal committed Sep 18, 2023
1 parent 46754d4 commit 2bb52cf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,23 @@ object NonEmptyLazyList extends NonEmptyLazyListInstances {
* Wraps a `LazyList` to be used as the tail of a `NonEmptyLazyList`,
* so that individual elements or `NonEmptyLazyList`s can be prepended to it
* to construct a non-empty result without evaluating any elements.
*
* @example
* {{{
* val nell: NonEmptyLazyList[Int] = 4 #:: NonEmptyLazyList.tail(LazyList.from(5))
* }}}
*/
def tail[A](ll: => LazyList[A]): Tail[A] = new Tail(LazyList.empty #::: ll)

/**
* A wrapped empty `LazyList` to be used as the tail of a `NonEmptyLazyList`,
* so that individual elements or `NonEmptyLazyList`s can be prepended to it
* to construct a non-empty result without evaluating any elements.
*
* @example
* {{{
* val nell: NonEmptyLazyList[Int] = 4 #:: NonEmptyLazyList.emptyTail
* }}}
*/
def emptyTail[A]: Tail[A] = new Tail(LazyList.empty)

Expand All @@ -107,7 +117,7 @@ object NonEmptyLazyList extends NonEmptyLazyListInstances {
create(elem #:: ll)

/** Prepends a `NonEmptyLazyList`, yielding a `NonEmptyLazyList`. */
def #:::[AA >: A](prefix: => NonEmptyLazyList[AA])(implicit d: DummyImplicit): NonEmptyLazyList[AA] =
def #:::[AA >: A](prefix: => NonEmptyLazyList[AA]): NonEmptyLazyList[AA] =
create(LazyList.empty #::: prefix.toLazyList #::: ll)
}

Expand Down

0 comments on commit 2bb52cf

Please sign in to comment.