File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
src/main/scala/fpinscalalib Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -44,12 +44,18 @@ object ErrorHandlingSection extends FlatSpec with Matchers with org.scalaexercis
44
44
case _ => None
45
45
}
46
46
47
- // We can look for our employees, and try to obtain their departments. We will assume that we won't find any errors,
48
- // and if it's the case, we don't have to worry as the computation will end there. Try to use `map` on the result of
49
- // calling `lookupByName` to create a function to obtain the department of each employee. Hint: to access the
50
- // optional employee, use Scala's underscore notation. i.e.:
51
- //
52
- // _.getOrElse(Employee("John", "Doe", None))
47
+ /**
48
+ * We can look for our employees, and try to obtain their departments. We will assume that we won't find any errors,
49
+ * and if it's the case, we don't have to worry as the computation will end there. Try to use `map` on the result of
50
+ * calling `lookupByName` to create a function to obtain the department of each employee. Hint: to access the
51
+ * optional employee, use Scala's underscore notation. i.e.:
52
+ *
53
+ * _.getOrElse(Employee("John", "Doe", None))
54
+ *
55
+ * Employee is defined as:
56
+ *
57
+ * case class Employee(name: String, department: String, manager: Option[String])
58
+ */
53
59
54
60
def getDepartment : (Option [Employee ]) => Option [String ] = res0
55
61
You can’t perform that action at this time.
0 commit comments