Commit c7774089 authored by Alexander Gehrke's avatar Alexander Gehrke
Browse files

[02] Add note to HERE BE DRAGONS part

parent 9373d22d
......@@ -32,6 +32,10 @@ object FP02 {
/// HERE BE DRAGONS -- DO NOT READ AHEAD!
/* The `map2` method is not included in the standard library. Here we add it
* to the existing Option, List and Either types via an implicit class.
*
* We will learn about implicits later in the lecture. */
implicit class Map2ForOption[A](o: Option[A]) {
def map2[B,R](p: Option[B])(f: (A,B) => R): Option[R] = for {
a <- o
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment