Skip to content

Commit

Permalink
Fix two small errors in OptionT docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rgcase committed Jan 25, 2016
1 parent d8e7e78 commit 03f625a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/main/tut/optiont.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ val result: Future[Option[String]] = ot.value // Future(Some("Hello Jane Doe"))

## Beyond map

Sometimes the operation you want to perform on an `Option[Future[String]]` might not be as simple as just wrapping the `Option` method in a `Future.map` call. For example, what if we want to greet the customer with their custom greeting if it exists but otherwise fall back to a default `Future[String]` greeting? Without `OptionT`, this implementation might look like:
Sometimes the operation you want to perform on an `Future[Option[String]]` might not be as simple as just wrapping the `Option` method in a `Future.map` call. For example, what if we want to greet the customer with their custom greeting if it exists but otherwise fall back to a default `Future[String]` greeting? Without `OptionT`, this implementation might look like:

```tut:silent
val defaultGreeting: Future[String] = Future.successful("hello, there")
Expand All @@ -91,7 +91,7 @@ val greeting: Future[String] = customGreetingT.getOrElseF(defaultGreeting)

## Getting to the underlying instance

If you want to get the `F[Option[A]` value (in this case `Future[Option[String]]`) out of an `OptionT` instance, you can simply call `value`:
If you want to get the `F[Option[A]]` value (in this case `Future[Option[String]]`) out of an `OptionT` instance, you can simply call `value`:

```tut:silent
val customGreeting: Future[Option[String]] = customGreetingT.value
Expand Down

0 comments on commit 03f625a

Please sign in to comment.