Skip to content

Commit

Permalink
remove the OptionT method, seems limited in value
Browse files Browse the repository at this point in the history
  • Loading branch information
johnynek committed May 7, 2018
1 parent 6e05158 commit 4da23e1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
8 changes: 0 additions & 8 deletions core/src/main/scala/cats/data/OptionT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,6 @@ final case class OptionT[F[_], A](value: F[Option[A]]) {
* }}}
*/
def toNested: Nested[F, Option, A] = Nested(value)

/**
* This repeats an F until we get defined values. This can be useful
* for polling type operations on State (or RNG) Monads, or in effect
* monads.
*/
def untilDefined(implicit F: FlatMap[F]): F[A] =
(new syntax.FlatMapOptionOps(value)).untilDefinedM
}

object OptionT extends OptionTInstances {
Expand Down
4 changes: 1 addition & 3 deletions tests/src/test/scala/cats/tests/IndexedStateTSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tests

import catalysts.Platform
import cats.arrow.{Profunctor, Strong}
import cats.data.{EitherT, IndexedStateT, OptionT, State, StateT}
import cats.data.{EitherT, IndexedStateT, State, StateT}
import cats.arrow.Profunctor
import cats.kernel.instances.tuple._
import cats.laws.discipline._
Expand Down Expand Up @@ -280,8 +280,6 @@ class IndexedStateTSuite extends CatsSuite {
}

counter.untilDefinedM.run(0).value should === ((stackSafeTestSize + 2, stackSafeTestSize + 1))

OptionT(counter).untilDefined.run(0).value should === ((stackSafeTestSize + 2, stackSafeTestSize + 1))
}

test("foreverM works") {
Expand Down

0 comments on commit 4da23e1

Please sign in to comment.