Skip to content

Instantly share code, notes, and snippets.

@theboreddev
Created November 20, 2021 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theboreddev/39f10670a3954d8855fdc0e3e4d50360 to your computer and use it in GitHub Desktop.
Save theboreddev/39f10670a3954d8855fdc0e3e4d50360 to your computer and use it in GitHub Desktop.
!! operator
fun generatePayrollFor(employeeName: String): Either<Problem, Payroll> {
return employeeService.findEmployeeByName(employeeName)
.flatMap { employee ->
buildPayrollForEmployee(employee!!)
}.tapLeft {
logger.info("Could not fetch employee: ${it.message()}")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment