Permalink
Browse files

Add missing explicit return type on public api methods.

Serve as documentation, should improve compile time and avoid
accidentally leaking implementations details.
  • Loading branch information...
jbgi committed Apr 13, 2017
1 parent b9ab36a commit fdbf1e3696b03929c39f3cf688460d2169116999
Showing with 318 additions and 314 deletions.
  1. +1 −1 concurrent/src/main/scala/scalaz/concurrent/BooleanLatch.scala
  2. +2 −2 concurrent/src/main/scala/scalaz/concurrent/PhasedLatch.scala
  3. +1 −1 concurrent/src/main/scala/scalaz/concurrent/Strategy.scala
  4. +1 −1 core/src/main/scala/scalaz/Apply.scala
  5. +1 −1 core/src/main/scala/scalaz/Bind.scala
  6. +1 −1 core/src/main/scala/scalaz/Dequeue.scala
  7. +3 −3 core/src/main/scala/scalaz/Either3.scala
  8. +1 −1 core/src/main/scala/scalaz/EphemeralStream.scala
  9. +18 −18 core/src/main/scala/scalaz/FingerTree.scala
  10. +1 −1 core/src/main/scala/scalaz/Foldable.scala
  11. +15 −15 core/src/main/scala/scalaz/Heap.scala
  12. +2 −2 core/src/main/scala/scalaz/ImmutableArray.scala
  13. +3 −3 core/src/main/scala/scalaz/Inject.scala
  14. +28 −28 core/src/main/scala/scalaz/Injective.scala
  15. +1 −1 core/src/main/scala/scalaz/Kleisli.scala
  16. +3 −3 core/src/main/scala/scalaz/LazyEither.scala
  17. +2 −2 core/src/main/scala/scalaz/LazyOption.scala
  18. +11 −10 core/src/main/scala/scalaz/Lens.scala
  19. +1 −1 core/src/main/scala/scalaz/Maybe.scala
  20. +1 −1 core/src/main/scala/scalaz/MaybeT.scala
  21. +1 −1 core/src/main/scala/scalaz/MonadPlus.scala
  22. +2 −2 core/src/main/scala/scalaz/Monoid.scala
  23. +2 −2 core/src/main/scala/scalaz/NaturalTransformation.scala
  24. +1 −1 core/src/main/scala/scalaz/OptionT.scala
  25. +7 −7 core/src/main/scala/scalaz/Order.scala
  26. +3 −3 core/src/main/scala/scalaz/PLens.scala
  27. +2 −2 core/src/main/scala/scalaz/Representable.scala
  28. +4 −4 core/src/main/scala/scalaz/Semigroup.scala
  29. +1 −1 core/src/main/scala/scalaz/StateT.scala
  30. +1 −1 core/src/main/scala/scalaz/StoreT.scala
  31. +1 −1 core/src/main/scala/scalaz/Traverse.scala
  32. +1 −1 core/src/main/scala/scalaz/Traverse1.scala
  33. +3 −3 core/src/main/scala/scalaz/UnwriterT.scala
  34. +3 −3 core/src/main/scala/scalaz/WriterT.scala
  35. +1 −1 core/src/main/scala/scalaz/Zip.scala
  36. +2 −2 core/src/main/scala/scalaz/Zipper.scala
  37. +10 −10 core/src/main/scala/scalaz/std/AnyVal.scala
  38. +1 −1 core/src/main/scala/scalaz/std/java/Enum.scala
  39. +10 −10 core/src/main/scala/scalaz/syntax/ApplicativeBuilder.scala
  40. +2 −2 core/src/main/scala/scalaz/syntax/ApplicativeSyntax.scala
  41. +1 −1 core/src/main/scala/scalaz/syntax/ApplySyntax.scala
  42. +4 −4 core/src/main/scala/scalaz/syntax/BindSyntax.scala
  43. +2 −2 core/src/main/scala/scalaz/syntax/CobindSyntax.scala
  44. +1 −1 core/src/main/scala/scalaz/syntax/ContTOps.scala
  45. +1 −1 core/src/main/scala/scalaz/syntax/EitherOps.scala
  46. +1 −1 core/src/main/scala/scalaz/syntax/EqualSyntax.scala
  47. +1 −1 core/src/main/scala/scalaz/syntax/FoldableSyntax.scala
  48. +4 −4 core/src/main/scala/scalaz/syntax/FunctorSyntax.scala
  49. +2 −2 core/src/main/scala/scalaz/syntax/KleisliOps.scala
  50. +1 −1 core/src/main/scala/scalaz/syntax/MaybeOps.scala
  51. +1 −1 core/src/main/scala/scalaz/syntax/MonadErrorSyntax.scala
  52. +2 −2 core/src/main/scala/scalaz/syntax/MonadPlusSyntax.scala
  53. +1 −1 core/src/main/scala/scalaz/syntax/MonadTransSyntax.scala
  54. +1 −1 core/src/main/scala/scalaz/syntax/NonEmptyListOps.scala
  55. +1 −1 core/src/main/scala/scalaz/syntax/PlusSyntax.scala
  56. +1 −1 core/src/main/scala/scalaz/syntax/ReducerOps.scala
  57. +1 −1 core/src/main/scala/scalaz/syntax/StateOps.scala
  58. +1 −1 core/src/main/scala/scalaz/syntax/TraverseSyntax.scala
  59. +1 −1 core/src/main/scala/scalaz/syntax/TreeOps.scala
  60. +1 −1 core/src/main/scala/scalaz/syntax/ValidationOps.scala
  61. +1 −1 core/src/main/scala/scalaz/syntax/WriterOps.scala
  62. +15 −15 core/src/main/scala/scalaz/syntax/std/BooleanOps.scala
  63. +1 −1 core/src/main/scala/scalaz/syntax/std/Function2Ops.scala
  64. +1 −1 core/src/main/scala/scalaz/syntax/std/OptionIdOps.scala
  65. +1 −1 effect/src/main/scala/scalaz/effect/IO.scala
  66. +1 −1 effect/src/main/scala/scalaz/effect/IoExceptionOr.scala
  67. +11 −10 effect/src/main/scala/scalaz/effect/MonadCatchIO.scala
  68. +1 −1 effect/src/main/scala/scalaz/effect/ST.scala
  69. +1 −1 effect/src/main/scala/scalaz/syntax/effect/MonadCatchIOSyntax.scala
  70. +1 −1 effect/src/main/scala/scalaz/syntax/effect/ResourceSyntax.scala
  71. +12 −10 iteratee/src/main/scala/scalaz/iteratee/EnumeratorP.scala
  72. +1 −1 iteratee/src/main/scala/scalaz/iteratee/EnumeratorT.scala
  73. +3 −3 iteratee/src/main/scala/scalaz/iteratee/Input.scala
  74. +2 −2 iteratee/src/main/scala/scalaz/iteratee/StepT.scala
  75. +6 −6 scalacheck-binding/src/main/scala/scalaz/scalacheck/ScalazArbitrary.scala
  76. +76 −76 scalacheck-binding/src/main/scala/scalaz/scalacheck/ScalazProperties.scala
@@ -9,7 +9,7 @@ trait BooleanLatch {
}
object BooleanLatch {
def apply() = new BooleanLatch {
def apply(): BooleanLatch = new BooleanLatch {
val sync = new AbstractQueuedSynchronizer {
val RELEASED = 0
val UNAVAILABLE = -1
@@ -12,11 +12,11 @@ sealed abstract class PhasedLatch {
/** Await the current phase. */
@throws(classOf[InterruptedException])
final def await() = currentPhase flatMap awaitPhase
final def await(): IO[Unit] = currentPhase flatMap awaitPhase
/** Await the current phase for the specified period. */
@throws(classOf[InterruptedException])
final def awaitFor(time: Long, unit: TimeUnit) = currentPhase flatMap { awaitPhaseFor(_, time, unit) }
final def awaitFor(time: Long, unit: TimeUnit): IO[Boolean] = currentPhase flatMap { awaitPhaseFor(_, time, unit) }
/** Await for the specified phase.*/
@throws(classOf[InterruptedException])
@@ -22,7 +22,7 @@ trait Strategys extends StrategysLow {
/**
* Default thread factory to mark all threads as daemon
*/
val DefaultDaemonThreadFactory = new ThreadFactory {
val DefaultDaemonThreadFactory: ThreadFactory = new ThreadFactory {
val defaultThreadFactory = Executors.defaultThreadFactory()
def newThread(r: Runnable) = {
val t = defaultThreadFactory.newThread(r)
@@ -159,7 +159,7 @@ trait Apply[F[_]] extends Functor[F] { self =>
trait ApplyLaw extends FunctorLaw {
/** Lifted functions can be fused. */
def composition[A, B, C](fbc: F[B => C], fab: F[A => B], fa: F[A])(implicit FC: Equal[F[C]]) =
def composition[A, B, C](fbc: F[B => C], fab: F[A => B], fa: F[A])(implicit FC: Equal[F[C]]): Boolean =
FC.equal(ap(ap(fa)(fab))(fbc),
ap(fa)(ap(fab)(map(fbc)((bc: B => C) => (ab: A => B) => bc compose ab))))
}
@@ -22,7 +22,7 @@ trait Bind[F[_]] extends Apply[F] { self =>
/** Sequence the inner `F` of `FFA` after the outer `F`, forming a
* single `F[A]`. */
def join[A](ffa: F[F[A]]) = bind(ffa)(a => a)
def join[A](ffa: F[F[A]]): F[A] = bind(ffa)(a => a)
// derived functions
@@ -175,7 +175,7 @@ sealed abstract class Dequeue[A] {
}
object Dequeue extends DequeueInstances {
def apply[A](as: A*) = as.foldLeft[Dequeue[A]](empty)((q,a) q :+ a)
def apply[A](as: A*): Dequeue[A] = as.foldLeft[Dequeue[A]](empty)((q, a) q :+ a)
def fromFoldable[F[_],A](fa: F[A])(implicit F: Foldable[F]): Dequeue[A] =
F.foldLeft[A,Dequeue[A]](fa,empty)((q,a) q :+ a)
@@ -22,9 +22,9 @@ sealed abstract class Either3[+A, +B, +C] extends Product with Serializable {
case Right3(c) => \/-(\/-(c))
}
def leftOr[Z](z: => Z)(f: A => Z) = fold(f, _ => z, _ => z)
def middleOr[Z](z: => Z)(f: B => Z) = fold(_ => z, f, _ => z)
def rightOr[Z](z: => Z)(f: C => Z) = fold(_ => z, _ => z, f)
def leftOr[Z](z: => Z)(f: A => Z): Z = fold(f, _ => z, _ => z)
def middleOr[Z](z: => Z)(f: B => Z): Z = fold(_ => z, f, _ => z)
def rightOr[Z](z: => Z)(f: C => Z): Z = fold(_ => z, _ => z, f)
}
final case class Left3[+A, +B, +C](a: A) extends Either3[A, B, C]
@@ -65,7 +65,7 @@ sealed abstract class EphemeralStream[A] {
def map[B](f: A => B): EphemeralStream[B] =
flatMap(x => EphemeralStream(f(x)))
def length = {
def length: Int = {
def addOne(c: => Int)(a: => A) = 1 + c
foldLeft(0)(addOne _)
}
@@ -280,13 +280,13 @@ sealed abstract class Node[V, A](implicit r: Reducer[A, V]) {
(v, a1, a2) => m.append(f(a1), f(a2)),
(v, a1, a2, a3) => m.append(m.append(f(a1), f(a2)), f(a3)))
def toDigit = fold(
def toDigit: Finger[V, A] = fold(
(v, a1, a2) => Two(v, a1, a2),
(v, a1, a2, a3) => Three(v, a1, a2, a3))
val measure: V
def map[B, V2](f: A => B)(implicit m: Reducer[B, V2]) = fold(
def map[B, V2](f: A => B)(implicit m: Reducer[B, V2]): Node[V2, B] = fold(
(v, a1, a2) => node2(f(a1), f(a2)),
(v, a1, a2, a3) => node3(f(a1), f(a2), f(a3)))
@@ -296,11 +296,11 @@ sealed abstract class Node[V, A](implicit r: Reducer[A, V]) {
(_, a1, a2, a3) => { f(a1); f(a2); f(a3) }
)}
def iterator = fold(
def iterator: Iterator[A] = fold(
(_, a1, a2) => Iterator(a1, a2),
(_, a1, a2, a3) => Iterator(a1, a2, a3))
def reverseIterator = fold(
def reverseIterator: Iterator[A] = fold(
(_, a1, a2) => Iterator(a2, a1),
(_, a1, a2, a3) => Iterator(a3, a2, a1))
@@ -868,7 +868,7 @@ sealed abstract class FingerTreeInstances {
t.fold(EmptyR[S, B], (xs, x) => OnR(s.map(xs)(f), f(x)))
}
implicit def fingerFoldable[V] =
implicit def fingerFoldable[V]: Foldable[Finger[V, ?]] =
new Foldable[Finger[V, ?]] with Foldable.FromFoldMap[Finger[V, ?]] {
override def foldMap[A, M: Monoid](v: Finger[V, A])(f: A => M) = v.foldMap(f)
}
@@ -890,7 +890,7 @@ sealed abstract class FingerTreeInstances {
UnitReducer((a: FingerTree[V, A]) => a.fold(v => v, (v, x) => v, (v, x, y, z) => v))
}
implicit def nodeFoldable[V] =
implicit def nodeFoldable[V]: Foldable[Node[V, ?]] =
new Foldable[Node[V, ?]] {
def foldMap[A, M: Monoid](t: Node[V, A])(f: A => M): M = t foldMap f
def foldRight[A, B](v: Node[V, A], z: => B)(f: (A, => B) => B): B =
@@ -934,14 +934,14 @@ sealed abstract class FingerTreeInstances {
object FingerTree extends FingerTreeInstances {
def Node2[V, A](v: V, a1: => A, a2: => A)(implicit r: Reducer[A, V]) =
def Node2[V, A](v: V, a1: => A, a2: => A)(implicit r: Reducer[A, V]): Node[V, A] =
new Node[V, A] {
def fold[B](two: (V, => A, => A) => B, three: (V, => A, => A, => A) => B) =
two(v, a1, a2)
val measure = v
}
def Node3[V, A](v: V, a1: => A, a2: => A, a3: => A)(implicit r: Reducer[A, V]) =
def Node3[V, A](v: V, a1: => A, a2: => A, a3: => A)(implicit r: Reducer[A, V]): Node[V, A] =
new Node[V, A] {
def fold[B](two: (V, => A, => A) => B, three: (V, => A, => A, => A) => B) =
three(v, a1, a2, a3)
@@ -968,28 +968,28 @@ object FingerTree extends FingerTreeInstances {
def fold[B](b: => B, f: (=> A, => S[A]) => B) = f(a, sa)
}
def one[V, A](a: A)(implicit measure: Reducer[A, V]) =
def one[V, A](a: A)(implicit measure: Reducer[A, V]): Finger[V, A] =
One(measure.unit(a), a)
def two[V, A](a1: A, a2: A)(implicit measure: Reducer[A, V]) =
def two[V, A](a1: A, a2: A)(implicit measure: Reducer[A, V]): Finger[V, A] =
Two(measure.snoc(measure.unit(a1), a2), a1, a2)
def three[V, A](a1: A, a2: A, a3: A)(implicit measure: Reducer[A, V]) =
def three[V, A](a1: A, a2: A, a3: A)(implicit measure: Reducer[A, V]): Finger[V, A] =
Three(measure.snoc(measure.snoc(measure.unit(a1), a2), a3), a1, a2, a3)
def four[V, A](a1: A, a2: A, a3: A, a4: A)(implicit measure: Reducer[A, V]) =
def four[V, A](a1: A, a2: A, a3: A, a4: A)(implicit measure: Reducer[A, V]): Finger[V, A] =
Four(measure.snoc(measure.snoc(measure.snoc(measure.unit(a1), a2), a3), a4), a1, a2, a3, a4)
def node2[V, A](a: A, b: A)(implicit measure: Reducer[A, V]) =
def node2[V, A](a: A, b: A)(implicit measure: Reducer[A, V]): Node[V, A] =
Node2[V, A](measure.snoc(measure.unit(a), b), a, b)
def node3[V, A](a: A, b: A, c: A)(implicit measure: Reducer[A, V]) =
def node3[V, A](a: A, b: A, c: A)(implicit measure: Reducer[A, V]): Node[V, A] =
Node3[V, A](measure.snoc(measure.snoc(measure.unit(a), b), c), a, b, c)
def mappendVal[V, A](v: V, t: FingerTree[V, A])(implicit measure: Reducer[A, V]) =
def mappendVal[V, A](v: V, t: FingerTree[V, A])(implicit measure: Reducer[A, V]): V =
t.fold(x => v, (x, y) => fingerTreeMeasure[A, V].snoc(v, t), (x, p, m, s) => fingerTreeMeasure[A, V].snoc(v, t))
def empty[V, A](implicit ms: Reducer[A, V]) =
def empty[V, A](implicit ms: Reducer[A, V]): FingerTree[V, A] =
new FingerTree[V, A] {
def fold[B](b: V => B, s: (V, A) => B, d: (V, Finger[V, A], => FingerTree[V, Node[V, A]], Finger[V, A]) => B): B = b(ms.monoid.zero)
}
@@ -1080,8 +1080,8 @@ object IndSeq extends IndSeqInstances {
import std.anyVal._
def apply[A](as: A*) = fromSeq(as)
def fromSeq[A](as: Seq[A]) = indSeq(as.foldLeft(empty[Int, A](UnitReducer(a => 1)))((x, y) => x :+ y))
def apply[A](as: A*): IndSeq[A] = fromSeq(as)
def fromSeq[A](as: Seq[A]): IndSeq[A] = indSeq(as.foldLeft(empty[Int, A](UnitReducer(a => 1)))((x, y) => x :+ y))
}
sealed abstract class IndSeqInstances {
@@ -109,7 +109,7 @@ trait Foldable[F[_]] { self =>
def foldr1Opt[A](fa: F[A])(f: A => (=> A) => A): Option[A] = foldRight(fa, None: Option[A])((a, optA) => optA map (aa => f(a)(aa)) orElse Some(a))
/**Curried version of `foldLeft` */
final def foldl[A, B](fa: F[A], z: B)(f: B => A => B) = foldLeft(fa, z)((b, a) => f(b)(a))
final def foldl[A, B](fa: F[A], z: B)(f: B => A => B): B = foldLeft(fa, z)((b, a) => f(b)(a))
def foldMapLeft1Opt[A, B](fa: F[A])(z: A => B)(f: (B, A) => B): Option[B] =
foldLeft(fa, None: Option[B])((optB, a) =>
optB map (f(_, a)) orElse Some(z(a)))
@@ -22,19 +22,19 @@ sealed abstract class Heap[A] {
def fold[B](empty: => B, nonempty: (Int, (A, A) => Boolean, Tree[Ranked[A]]) => B): B
/**Is the heap empty? O(1)*/
def isEmpty = fold(true, (_, _, _) => false)
def isEmpty: Boolean = fold(true, (_, _, _) => false)
/**Is the heap populated? O(1)*/
final def nonEmpty = !isEmpty
final def nonEmpty: Boolean = !isEmpty
/**The number of elements in the heap. O(1)*/
def size = fold(0, (s, _, _) => s)
def size: Int = fold(0, (s, _, _) => s)
/**Insert a new value into the heap. O(1)*/
def insert(a: A)(implicit o: Order[A]) = insertWith(o.lessThanOrEqual, a)
def insert(a: A)(implicit o: Order[A]): Heap[A] = insertWith(o.lessThanOrEqual, a)
/** Alias for insert */
final def +(a: A)(implicit o: Order[A]) = this insert a
final def +(a: A)(implicit o: Order[A]): Heap[A] = this insert a
def insertAll(as: TraversableOnce[A])(implicit o: Order[A]): Heap[A] =
(this /: as)((h,a) => h insert a)
@@ -43,7 +43,7 @@ sealed abstract class Heap[A] {
F.foldLeft(as, this)((h,a) => h insert a)
/**Meld the values from two heaps into one heap. O(1)*/
def union(as: Heap[A]) = (this, as) match {
def union(as: Heap[A]): Heap[A] = (this, as) match {
case (Empty(), q) => q
case (q, Empty()) => q
case (Heap(s1, leq, t1@Node(Ranked(r1, x1), f1)),
@@ -93,13 +93,13 @@ sealed abstract class Heap[A] {
def toList: List[A] = toStream.toList
/**Map a function over the heap, returning a new heap ordered appropriately. O(n)*/
def map[B: Order](f: A => B) = fold(Empty[B], (_, _, t) => t.foldMap(x => singleton(f(x.value))))
def map[B: Order](f: A => B): Heap[B] = fold(Empty[B], (_, _, t) => t.foldMap(x => singleton(f(x.value))))
def forall(f: A => Boolean) = toStream.forall(f)
def forall(f: A => Boolean): Boolean = toStream.forall(f)
def exists(f: A => Boolean) = toStream.exists(f)
def exists(f: A => Boolean): Boolean = toStream.exists(f)
def foreach(f: A => Unit) = toStream.foreach(f)
def foreach(f: A => Unit): Unit = toStream.foreach(f)
/**Filter the heap, retaining only values that satisfy the predicate. O(n)*/
def filter(p: A => Boolean): Heap[A] =
@@ -126,14 +126,14 @@ sealed abstract class Heap[A] {
}
/**Return a heap consisting of the least n elements of this heap. O(n log n) */
def take(n: Int) = withList(_.take(n))
def take(n: Int): Heap[A] = withList(_.take(n))
/**Return a heap consisting of all the members of this heap except for the least n. O(n log n) */
def drop(n: Int) = withList(_.drop(n))
def drop(n: Int): Heap[A] = withList(_.drop(n))
/**Split into two heaps, the first containing the n least elements, the second containing the n
* greatest elements. O(n log n) */
def splitAt(n: Int) = splitWithList(_.splitAt(n))
def splitAt(n: Int): (Heap[A], Heap[A]) = splitWithList(_.splitAt(n))
/**Returns a tuple where the first element is a heap consisting of the longest prefix of least elements
* in this heap that do not satisfy the given predicate, and the second element is the remainder
@@ -149,12 +149,12 @@ sealed abstract class Heap[A] {
/**Returns a heap consisting of the longest prefix of least elements of this heap that satisfy the predicate.
* O(n log n) */
def takeWhile(p: A => Boolean) =
def takeWhile(p: A => Boolean): Heap[A] =
withList(_.takeWhile(p))
/**Returns a heap consisting of the longest prefix of least elements of this heap that do not
* satisfy the predicate. O(n log n) */
def dropWhile(p: A => Boolean) =
def dropWhile(p: A => Boolean): Heap[A] =
withList(_.dropWhile(p))
/**Remove duplicate entries from the heap. O(n log n)*/
@@ -153,7 +153,7 @@ object ImmutableArray extends ImmutableArrayInstances {
// override def stringPrefix = "ImmutableArray"
// override protected[this] def newBuilder = ImmutableArray.newBuilder[A](elemTag)
def componentType = arr.getClass().getComponentType
def componentType: Class[_] = arr.getClass().getComponentType
def apply(idx: Int) = arr(idx)
@@ -324,7 +324,7 @@ object ImmutableArray extends ImmutableArrayInstances {
}
sealed class ImmutableArrayCharW(val self: ImmutableArray[Char]) extends Ops[ImmutableArray[Char]] {
def asString = self match {
def asString: String = self match {
case a: StringArray => a.str
case a: ofChar => wrapArray(a).mkString
case _ => sys.error("Unknown subtype of ImmutableArray[Char]")
@@ -15,19 +15,19 @@ sealed abstract class Inject[F[_], G[_]] extends (F ~> G) {
}
sealed abstract class InjectInstances {
implicit def reflexiveInjectInstance[F[_]] =
implicit def reflexiveInjectInstance[F[_]]: Inject[F, F] =
new Inject[F, F] {
def inj[A](fa: F[A]) = fa
def prj[A](ga: F[A]) = some(ga)
}
implicit def leftInjectInstance[F[_], G[_]] =
implicit def leftInjectInstance[F[_], G[_]]: Inject[F, Coproduct[F, G, ?]] =
new Inject[F, Coproduct[F, G, ?]] {
def inj[A](fa: F[A]) = Coproduct.leftc(fa)
def prj[A](ga: Coproduct[F, G, A]) = ga.run.fold(some(_), _ => none)
}
implicit def rightInjectInstance[F[_], G[_], H[_]](implicit I: Inject[F, G]) =
implicit def rightInjectInstance[F[_], G[_], H[_]](implicit I: Inject[F, G]): Inject[F, Coproduct[H, G, ?]] =
new Inject[F, Coproduct[H, G, ?]] {
def inj[A](fa: F[A]) = Coproduct.rightc(I.inj(fa))
def prj[A](ga: Coproduct[H, G, A]) = ga.run.fold(_ => none, I.prj(_))
@@ -14,32 +14,32 @@ case class Injective4[T[_,_,_,_]]()
case class Injective5[T[_,_,_,_,_]]()
object Injectivity {
implicit def DisjunctionInjective = Injective2[\/]()
implicit def EitherInjective = Injective2[Either]()
implicit def FractionalInjective = Injective[Fractional]()
implicit def Function0Injective = Injective[Function0]()
implicit def Function1Injective = Injective2[Function1]()
implicit def Function2Injective = Injective3[Function2]()
implicit def Function3Injective = Injective4[Function3]()
implicit def Function4Injective = Injective5[Function4]()
implicit def IndexedSeqInjective = Injective[IndexedSeq]()
implicit def IntegralInjective = Injective[Integral]()
implicit def IterableInjective = Injective[Iterable]()
implicit def IteratorInjective = Injective[Iterator]()
implicit def ListInjective = Injective[List]()
implicit def OptionInjective = Injective[Option]()
implicit def PartialFunctionInjective = Injective2[PartialFunction]()
implicit def PartialOrderingInjective = Injective[PartialOrdering]()
implicit def Product1Injective = Injective[Product1]()
implicit def Product2Injective = Injective2[Product2]()
implicit def Product3Injective = Injective3[Product3]()
implicit def Product4Injective = Injective4[Product4]()
implicit def Product5Injective = Injective5[Product5]()
implicit def SetInjective = Injective[Set]()
implicit def Tuple2Injective = Injective2[Tuple2]()
implicit def Tuple3Injective = Injective3[Tuple3]()
implicit def Tuple4Injective = Injective4[Tuple4]()
implicit def Tuple5Injective = Injective5[Tuple5]()
implicit def ValidationInjective = Injective2[Validation]()
implicit def StreamInjective = Injective[Stream]()
implicit def DisjunctionInjective: Injective2[\/] = Injective2()
implicit def EitherInjective: Injective2[Either] = Injective2()
implicit def FractionalInjective: Injective[Fractional] = Injective()
implicit def Function0Injective: Injective[Function0] = Injective()
implicit def Function1Injective: Injective2[Function] = Injective2()
implicit def Function2Injective: Injective3[Function2] = Injective3()
implicit def Function3Injective: Injective4[Function3] = Injective4()
implicit def Function4Injective: Injective5[Function4] = Injective5()
implicit def IndexedSeqInjective: Injective[IndexedSeq] = Injective()
implicit def IntegralInjective: Injective[Integral] = Injective()
implicit def IterableInjective: Injective[Iterable] = Injective()
implicit def IteratorInjective: Injective[Iterator] = Injective()
implicit def ListInjective: Injective[List] = Injective()
implicit def OptionInjective: Injective[Option] = Injective()
implicit def PartialFunctionInjective: Injective2[PartialFunction] = Injective2()
implicit def PartialOrderingInjective: Injective[PartialOrdering] = Injective()
implicit def Product1Injective: Injective[Product1] = Injective()
implicit def Product2Injective: Injective2[Product2] = Injective2()
implicit def Product3Injective: Injective3[Product3] = Injective3()
implicit def Product4Injective: Injective4[Product4] = Injective4()
implicit def Product5Injective: Injective5[Product5] = Injective5()
implicit def SetInjective: Injective[Set] = Injective()
implicit def Tuple2Injective: Injective2[Tuple2] = Injective2()
implicit def Tuple3Injective: Injective3[Tuple3] = Injective3()
implicit def Tuple4Injective: Injective4[Tuple4] = Injective4()
implicit def Tuple5Injective: Injective5[Tuple5] = Injective5()
implicit def ValidationInjective: Injective2[Validation] = Injective2()
implicit def StreamInjective: Injective[Stream] = Injective()
}
@@ -85,7 +85,7 @@ final case class Kleisli[M[_], A, B](run: A => M[B]) { self =>
def endo(implicit M: Functor[M], ev: A >~> B): Endomorphic[Kleisli[M, ?, ?], A] =
Endomorphic[Kleisli[M, ?, ?], A](map(ev.apply))
def liftF(implicit F: Functor[Kleisli[M, A, ?]]) =
def liftF(implicit F: Functor[Kleisli[M, A, ?]]): Free[Kleisli[M, A, ?], B] =
Free.liftF[Kleisli[M, A, ?], B](self)
def tap(implicit F: Applicative[M]): Kleisli[M, A, A] =
Oops, something went wrong.

0 comments on commit fdbf1e3

Please sign in to comment.