Skip to content

Commit

Permalink
A few more Unicode arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
travisbrown committed Jun 18, 2019
1 parent fbeef32 commit ac1d695
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/arrow/FunctionK.scala
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private[arrow] object FunctionKMacros {

private[this] def unblock(tree: Tree): Tree = tree match {
case Block(Nil, expr) => expr
case _ => tree
case _ => tree
}

private[this] def punchHole(tpe: Type): Tree = tpe match {
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/scala/cats/data/NonEmptySet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,17 @@ sealed class NonEmptySetOps[A](val value: NonEmptySet[A]) {
/**
* Tests whether a predicate holds for all elements of this set.
*/
def forall(p: A Boolean): Boolean = toSortedSet.forall(p)
def forall(p: A => Boolean): Boolean = toSortedSet.forall(p)

/**
* Tests whether a predicate holds for at least one element of this set.
*/
def exists(f: A Boolean): Boolean = toSortedSet.exists(f)
def exists(f: A => Boolean): Boolean = toSortedSet.exists(f)

/**
* Returns the first value that matches the given predicate.
*/
def find(f: A Boolean): Option[A] = toSortedSet.find(f)
def find(f: A => Boolean): Option[A] = toSortedSet.find(f)

/**
* Returns a new `SortedSet` containing all elements where the result of `pf` is defined.
Expand All @@ -223,12 +223,12 @@ sealed class NonEmptySetOps[A](val value: NonEmptySet[A]) {
/**
* Filters all elements of this set that do not satisfy the given predicate.
*/
def filter(p: A Boolean): SortedSet[A] = toSortedSet.filter(p)
def filter(p: A => Boolean): SortedSet[A] = toSortedSet.filter(p)

/**
* Filters all elements of this set that satisfy the given predicate.
*/
def filterNot(p: A Boolean): SortedSet[A] = filter(t => !p(t))
def filterNot(p: A => Boolean): SortedSet[A] = filter(t => !p(t))

/**
* Left-associative fold using f.
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/syntax/foldable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ final class FoldableOps[F[_], A](private val fa: F[A]) extends AnyVal {
*}}}
*/
def collectFold[M](f: PartialFunction[A, M])(implicit F: Foldable[F], M: Monoid[M]): M =
F.foldLeft(fa, M.empty)((acc, a) => M.combine(acc, f.applyOrElse(a, (_: A) M.empty)))
F.foldLeft(fa, M.empty)((acc, a) => M.combine(acc, f.applyOrElse(a, (_: A) => M.empty)))

/**
* Tear down a subset of this structure using a `A => Option[M]`.
Expand All @@ -199,7 +199,7 @@ final class FoldableOps[F[_], A](private val fa: F[A]) extends AnyVal {
(acc, a) =>
f(a) match {
case Some(x) => M.combine(acc, x)
case None => acc
case None => acc
}
)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/test/scala/cats/tests/FoldableSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ abstract class FoldableSuite[F[_]: Foldable](name: String)(implicit ArbFInt: Arb
}

test(s"Foldable[$name] partial summation") {
forAll { (fa: F[String], f: String => Boolean)
forAll { (fa: F[String], f: String => Boolean) =>
val m: Monoid[String] = Monoid[String]

val pf: PartialFunction[String, String] = {
Expand Down

0 comments on commit ac1d695

Please sign in to comment.