Skip to content

Commit 1b27ea6

Browse files
Merge pull request #28 from ricsirigu/patch-1
Missing Employee definition
2 parents 9c71d98 + b98ec9f commit 1b27ea6

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/main/scala/fpinscalalib/ErrorHandlingSection.scala

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,18 @@ object ErrorHandlingSection extends FlatSpec with Matchers with org.scalaexercis
4444
case _ => None
4545
}
4646

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+
*/
5359

5460
def getDepartment : (Option[Employee]) => Option[String] = res0
5561

0 commit comments

Comments
 (0)