@@ -19,7 +19,6 @@ package data
1919
2020import cats .instances .sortedSet ._
2121import cats .kernel ._
22- import cats .{Always , Eq , Eval , Foldable , Later , Now , Reducible , SemigroupK , Show }
2322
2423import scala .collection .immutable ._
2524
@@ -41,11 +40,11 @@ private[data] object NonEmptySetImpl extends NonEmptySetInstances with Newtype {
4140 else throw new IllegalArgumentException (" Cannot create NonEmptySet from empty set" )
4241
4342
44- def of [A : Order ](a : A , as : A * ): NonEmptySet [A ] =
45- create(SortedSet (( a +: as) : _* )(Order [ A ] .toOrdering))
46- def apply [A : Order ](head : A , tail : SortedSet [A ]): NonEmptySet [A ] =
47- create(SortedSet (head)(Order [ A ] .toOrdering) ++ tail)
48- def one [A : Order ](a : A ): NonEmptySet [A ] = create(SortedSet (a)(Order [ A ] .toOrdering))
43+ def of [A ](a : A , as : A * )( implicit A : Order [ A ] ): NonEmptySet [A ] =
44+ create(SortedSet (a +: as : _* )(A .toOrdering))
45+ def apply [A ](head : A , tail : SortedSet [ A ])( implicit A : Order [A ]): NonEmptySet [A ] =
46+ create(SortedSet (head)(A .toOrdering) ++ tail)
47+ def one [A ](a : A )( implicit A : Order [ A ]) : NonEmptySet [A ] = create(SortedSet (a)(A .toOrdering))
4948
5049 implicit def catsNonEmptySetOps [A ](value : NonEmptySet [A ]): NonEmptySetOps [A ] =
5150 new NonEmptySetOps (value)
@@ -137,8 +136,8 @@ sealed class NonEmptySetOps[A](val value: NonEmptySet[A]) {
137136 /**
138137 * Applies f to all the elements
139138 */
140- def map [B : Order ](f : A ⇒ B ): NonEmptySet [B ] =
141- NonEmptySetImpl .create(SortedSet (toSortedSet.map(f).to: _* )(Order [ B ] .toOrdering))
139+ def map [B ](f : A => B )( implicit B : Order [ B ] ): NonEmptySet [B ] =
140+ NonEmptySetImpl .create(SortedSet (toSortedSet.map(f).to: _* )(B .toOrdering))
142141
143142 /**
144143 * Converts this set to a `NonEmptyList`.
@@ -219,8 +218,8 @@ sealed class NonEmptySetOps[A](val value: NonEmptySet[A]) {
219218 /**
220219 * Returns a new `SortedSet` containing all elements where the result of `pf` is defined.
221220 */
222- def collect [B : Order ](pf : PartialFunction [A , B ]): SortedSet [B ] = {
223- implicit val ordering = Order [ B ] .toOrdering
221+ def collect [B ](pf : PartialFunction [A , B ])( implicit B : Order [ B ]): SortedSet [B ] = {
222+ implicit val ordering = B .toOrdering
224223 toSortedSet.collect(pf)
225224 }
226225
@@ -295,8 +294,8 @@ sealed class NonEmptySetOps[A](val value: NonEmptySet[A]) {
295294 * res0: cats.data.NonEmptySet[Int] = TreeSet(1, 2, 3, 4, 5, 8, 10, 12, 15)
296295 * }}}
297296 */
298- def concatMap [B : Order ](f : A => NonEmptySet [B ]): NonEmptySet [B ] = {
299- implicit val ordering = Order [ B ] .toOrdering
297+ def concatMap [B ](f : A => NonEmptySet [ B ])( implicit B : Order [B ]): NonEmptySet [B ] = {
298+ implicit val ordering = B .toOrdering
300299 NonEmptySetImpl .create(toSortedSet.flatMap(f andThen (_.toSortedSet)))
301300 }
302301
@@ -339,8 +338,8 @@ sealed class NonEmptySetOps[A](val value: NonEmptySet[A]) {
339338 * res0: cats.data.NonEmptySet[String] = TreeSet(1A, 2B, 3C)
340339 * }}}
341340 */
342- def zipWith [B , C : Order ](b : NonEmptySet [B ])(f : (A , B ) => C ): NonEmptySet [C ] =
343- NonEmptySetImpl .create(SortedSet ((toSortedSet, b.toSortedSet).zipped.map(f).to: _* )(Order [ C ] .toOrdering))
341+ def zipWith [B , C ](b : NonEmptySet [B ])(f : (A , B ) => C )( implicit C : Order [ C ] ): NonEmptySet [C ] =
342+ NonEmptySetImpl .create(SortedSet ((toSortedSet, b.toSortedSet).zipped.map(f).to: _* )(C .toOrdering))
344343
345344 /**
346345 * Zips this `NonEmptySet` with its index.
0 commit comments