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 2bfaaac
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 2bfaaac

Please sign in to comment.