Skip to content

Commit

Permalink
Move newtype to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka Jacobowitz committed Feb 11, 2018
1 parent bba1a5d commit 65fe31b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 8 additions & 0 deletions core/src/main/scala/cats/data/Newtype.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package cats
package data

trait Newtype { self =>
private[data] type Base
private[data] trait Tag extends Any
type Type[A] <: Base with Tag
}
7 changes: 1 addition & 6 deletions core/src/main/scala/cats/data/NonEmptySet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ import cats.{Always, Eq, Eval, Foldable, Later, Now, Reducible, SemigroupK, Show

import scala.collection.immutable._

trait Newtype { self =>
private[data] type Base
private[data] trait Tag extends Any
private[cats] type Type[A] <: Base with Tag
}

private[data] object NonEmptySetImpl extends NonEmptySetInstances with Newtype {

Expand Down Expand Up @@ -56,7 +51,7 @@ private[data] object NonEmptySetImpl extends NonEmptySetInstances with Newtype {
}


private[data] sealed class NonEmptySetOps[A](val value: NonEmptySetImpl.Type[A]) {
sealed class NonEmptySetOps[A](val value: NonEmptySet[A]) {

private implicit val ordering: Ordering[A] = toSortedSet.ordering
private implicit val order: Order[A] = Order.fromOrdering
Expand Down

0 comments on commit 65fe31b

Please sign in to comment.