Skip to content

Commit

Permalink
Merge pull request #825 from rgcase/optionTDocs
Browse files Browse the repository at this point in the history
Fix two small errors in OptionT docs
  • Loading branch information
ceedubs committed Jan 26, 2016
2 parents acbe54e + 03f625a commit 6dc0c32
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 6dc0c32

Please sign in to comment.