Skip to content

Commit

Permalink
make NonEmptyChainImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
satorg committed Jun 11, 2022
1 parent e9abf24 commit 96966e4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions core/src/main/scala/cats/data/NonEmptyChain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@
package cats
package data

import NonEmptyChainImpl.create

import cats.instances.StaticMethods
import cats.kernel._

import scala.collection.immutable.SortedMap

private[data] object NonEmptyChainImpl extends NonEmptyChainInstances with ScalaVersionSpecificNonEmptyChainImpl {
/**
* Actual implementation for [[cats.data.NonEmptyChain]]
*
* @note This object is kept public for the sake of binary compatibility only
* and therefore is subject to changes in future versions of Cats.
* Do not use directly - use [[cats.data.NonEmptyChain]] instead.
*/
object NonEmptyChainImpl extends NonEmptyChainInstances with ScalaVersionSpecificNonEmptyChainImpl {
// The following 3 types are components of a technique to
// create a no-boxing newtype. It's copied from the
// newtypes lib by @alexknvl
Expand Down Expand Up @@ -83,10 +88,12 @@ class NonEmptyChainOps[A](private val value: NonEmptyChain[A])
extends AnyVal
with NonEmptyCollection[A, Chain, NonEmptyChain] {

import NonEmptyChainImpl.{create, unwrap}

/**
* Converts this chain to a `Chain`
*/
final def toChain: Chain[A] = NonEmptyChainImpl.unwrap(value)
final def toChain: Chain[A] = unwrap(value)

/**
* Returns a new NonEmptyChain consisting of `a` followed by this. O(1) runtime.
Expand Down

0 comments on commit 96966e4

Please sign in to comment.