Skip to content

Commit

Permalink
make NonEmptyChainImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
satorg committed Jun 10, 2022
1 parent 064f735 commit 5cd610b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 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,15 @@
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 {
// For internal purposes only - do not use!
// This object is kept public for the sake of binary compatibility.
// The visibility can be changed in future versions.
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 +84,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 5cd610b

Please sign in to comment.