Skip to content

Commit

Permalink
Merge pull request #1445 from guersam/tmp/fix-monad-doc
Browse files Browse the repository at this point in the history
Fix tut in monad doc
  • Loading branch information
adelbertc authored Oct 30, 2016
2 parents 91242d0 + acbe892 commit bcc751f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/src/main/tut/typeclasses/monad.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ implicit val optionMonad = new Monad[Option] {
case Some(Left(nextA)) => tailRecM(nextA)(f) // continue the recursion
case Some(Right(b)) => Some(b) // recursion done
}
}
```

Part of the reason for this is that name `flatMap` has special significance in
Expand All @@ -108,6 +109,8 @@ the results of earlier ones. This is embodied in `ifM`, which lifts an `if`
statement into the monadic context.

```tut:book
import cats.implicits._
Monad[List].ifM(List(true, false, true))(List(1, 2), List(3, 4))
```

Expand Down

0 comments on commit bcc751f

Please sign in to comment.