Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/monocle/function/Empty.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object Empty extends EmptyFunctions {

implicit def sortedMapEmpty[K, V](implicit ok: Order[K]): Empty[SortedMap[K, V]] =
Empty(
Prism[SortedMap[K, V], Unit](m => if (m.isEmpty) Some(()) else None)(_ => SortedMap.empty(ok.toOrdering))
Prism[SortedMap[K, V], Unit](m => if (m.isEmpty) Some(()) else None)(_ => SortedMap.empty(using ok.toOrdering))
)

implicit def optionEmpty[A]: Empty[Option[A]] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ object FilterIndex extends FilterIndexFunctions {
.traverse { case (k, v) =>
(if (predicate(k)) f(v) else v.pure[F]).tupleLeft(k)
}
.map(kvs => SortedMap(kvs*)(ok.toOrdering))
.map(kvs => SortedMap(kvs*)(using ok.toOrdering))
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/shared/src/test/scala/monocle/function/Data.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object MSorteMap {

implicit def mmapEq[K, V]: Eq[MSorteMap[K, V]] = Eq.fromUniversalEquals
implicit def mmapArb[K: Arbitrary, V: Arbitrary](implicit ok: Order[K]): Arbitrary[MSorteMap[K, V]] =
Arbitrary(Arbitrary.arbitrary[List[(K, V)]].map(kvs => MSorteMap(SortedMap(kvs*)(ok.toOrdering))))
Arbitrary(Arbitrary.arbitrary[List[(K, V)]].map(kvs => MSorteMap(SortedMap(kvs*)(using ok.toOrdering))))
}

case class MMap[K, V](map: Map[K, V])
Expand Down