Skip to content

Commit

Permalink
Remove defaultTailRecM from monad doc
Browse files Browse the repository at this point in the history
  • Loading branch information
guersam committed Oct 27, 2016
1 parent 25e9628 commit 5c4f963
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/src/main/tut/typeclasses/monad.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ implicit def optionTMonad[F[_]](implicit F : Monad[F]) = {
}
}
def tailRecM[A, B](a: A)(f: A => OptionT[F, Either[A, B]]): OptionT[F, B] =
defaultTailRecM(a)(f)
OptionT {
F.flatMap(f(a).value) {
case None => F.pure(None)
case Some(Right(b)) => F.pure(Some(b))
case Some(Left(a2)) => tailRecM(a2)(f).value
}
}
}
}
```
Expand Down

0 comments on commit 5c4f963

Please sign in to comment.