Skip to content

Commit

Permalink
Merge pull request #1444 from guersam/tmp/doc-rm-defaulttailrecm
Browse files Browse the repository at this point in the history
Remove `defaultTailRecM` from monad doc
  • Loading branch information
non authored Oct 27, 2016
2 parents 8f127ce + 2bfaaac commit 91242d0
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 @@ -136,8 +136,14 @@ implicit def optionTMonad[F[_]](implicit F : Monad[F]) = {
case Some(a) => f(a).value
}
}
def tailRecM[A, B](a: A)(f: A => OptionT[F, Either[A, B]]): OptionT[F, B] =
defaultTailRecM(a)(f)
OptionT {
F.tailRecM(a)(a0 => F.map(f(a0).value) {
case None => Either.right[A, Option[B]](None)
case Some(b0) => b0.map(Some(_))
})
}
}
}
```
Expand Down

0 comments on commit 91242d0

Please sign in to comment.