Skip to content

Commit

Permalink
fix the typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonqu committed Nov 11, 2013
1 parent 6d0042c commit 81f4a3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/collections.textile
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,18 @@ We would suggest that you use either <code>getOrElse</code> or pattern matching

<code>getOrElse</code> lets you easily define a default value.

<code>
<pre>
val result = res1.getOrElse(0) * 2
</code>
</pre>

Pattern matching fits naturally with <code>Option</code>.

<code>
<pre>
val result = res1 match {
case Some(n) => n * 2
case None => 0
}
</code>
</pre>

*See Also* Effective Scala has opinions about <a href="http://twitter.github.com/effectivescala/#Functional programming-Options">Options</a>.

Expand Down

0 comments on commit 81f4a3b

Please sign in to comment.