Skip to content

Commit

Permalink
Remove arrow instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Itamar Ravid committed Sep 11, 2017
1 parent b864100 commit 0870bdd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
31 changes: 0 additions & 31 deletions core/src/main/scala/cats/data/ReaderWriterStateT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cats
package data

import cats.functor.{ Bifunctor, Contravariant, Profunctor, Strong }
import cats.arrow.Arrow
import cats.syntax.either._

/**
Expand Down Expand Up @@ -458,13 +457,6 @@ private[data] sealed abstract class IRWSTInstances2 extends IRWSTInstances3 {
implicit def F: Monad[F] = FM
implicit def L: Monoid[L] = L0
}

implicit def catsDataArrowForIRWST[F[_], E, L, T](implicit F0: Monad[F], L0: Monoid[L], T0: Monoid[T]): Arrow[IndexedReaderWriterStateT[F, E, L, ?, ?, T]] =
new IRWSTArrow[F, E, L, T] {
implicit def F: Monad[F] = F0
implicit def L: Monoid[L] = L0
implicit def T: Monoid[T] = T0
}
}

private[data] sealed abstract class IRWSTInstances3 {
Expand Down Expand Up @@ -516,29 +508,6 @@ private[data] sealed abstract class IRWSTStrong[F[_], E, L, T] extends IRWSTProf
first(fa).dimap((_: (C, A)).swap)(_.swap)
}

private[data] sealed abstract class IRWSTArrow[F[_], E, L, T] extends IRWSTStrong[F, E, L, T] with Arrow[IndexedReaderWriterStateT[F, E, L, ?, ?, T]] {
implicit def F: Monad[F]
implicit def T: Monoid[T]
implicit def L: Monoid[L]

def lift[A, B](f: A => B): IndexedReaderWriterStateT[F, E, L, A, B, T] =
IndexedReaderWriterStateT { (e, a) =>
F.pure((L.empty, f(a), T.empty))
}

def id[A]: IndexedReaderWriterStateT[F, E, L, A, A, T] =
IndexedReaderWriterStateT.pure(T.empty)

def compose[A, B, C](f: IndexedReaderWriterStateT[F, E, L, B, C, T], g: IndexedReaderWriterStateT[F, E, L, A, B, T]): IndexedReaderWriterStateT[F, E, L, A, C, T] =
IndexedReaderWriterStateT { (e, a) =>
F.flatMap(g.run(e, a)) { case (la, b, ta) =>
F.map(f.run(e, b)) { case (lb, c, tb) =>
(L.combine(la, lb), c, T.combine(ta, tb))
}
}
}
}

private[data] sealed abstract class IRWSTBifunctor[F[_], E, L, SA] extends Bifunctor[IndexedReaderWriterStateT[F, E, L, SA, ?, ?]] {
implicit def F: Functor[F]

Expand Down
6 changes: 0 additions & 6 deletions tests/src/test/scala/cats/tests/ReaderWriterStateTTests.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cats
package tests

import cats.arrow.Arrow
import cats.data.{ IRWST, IndexedReaderWriterStateT, ReaderWriterStateT, ReaderWriterState, EitherT }
import cats.functor.{ Contravariant, Bifunctor, Profunctor, Strong }
import cats.laws.discipline._
Expand Down Expand Up @@ -328,11 +327,6 @@ class ReaderWriterStateTTests extends CatsSuite {
checkAll("Strong[IndexedReaderWriterStateT[ListWrapper, String, String, ?, ?, Int]]",
SerializableTests.serializable(Strong[IndexedReaderWriterStateT[ListWrapper, String, String, ?, ?, Int]]))

checkAll("IndexedReaderWriterStateT[ListWrapper, String, String, Int, String, Int]",
ArrowTests[IndexedReaderWriterStateT[ListWrapper, String, String, ?, ?, Int]].arrow[Int, Int, Int, String, String, String])
checkAll("Arrow[IndexedReaderWriterStateT[ListWrapper, String, String, ?, ?, Int]]",
SerializableTests.serializable(Arrow[IndexedReaderWriterStateT[ListWrapper, String, String, ?, ?, Int]]))

checkAll("IndexedReaderWriterStateT[ListWrapper, String, String, Int, Int, String]",
BifunctorTests[IndexedReaderWriterStateT[ListWrapper, String, String, Int, ?, ?]].bifunctor[Int, Int, Int, String, String, String])
checkAll("Bifunctor[IndexedReaderWriterStateT[ListWrapper, String, String, Int, ?, ?]]",
Expand Down

0 comments on commit 0870bdd

Please sign in to comment.