Left is the error-carrying case of an Either value. It holds failure details while Right holds success, so a computation can return one value and still explain what went wrong. section 5.3
Use Left when a result may fail and you want the failure to travel with the value. This keeps error handling inside the data flow instead of splitting it into separate checks. section 5.3
Left appears in these failure-handling patterns:
- Wrap a missing lookup result with an error message or exception object. section 5.3
Lookup failure with Left
A safe student lookup returns Either.of(obj) when found, and Left('Object not found with ID: ...') when missing. That lets later code keep chaining without crashing.
Left is tied to Either, Right, error handling, and recovery methods such as getOrElse and orElse. It contrasts with Maybe, which can hide absence but not explain the cause. section 5.3
