Skip to content

Commit b98ec9f

Browse files
authored
Employee definition inside a comment
1 parent a2e1dff commit b98ec9f

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/main/scala/fpinscalalib/ErrorHandlingSection.scala

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +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))
53-
54-
case class Employee(name: String, department: String, manager: Option[String])
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+
*/
5559

5660
def getDepartment : (Option[Employee]) => Option[String] = res0
5761

0 commit comments

Comments
 (0)