In the previous lesson, you learned the structure of Either
and its basic operations. In this lesson, you’ll learn about other useful methods the class Either
has to offer. They are very similar to the one you saw for Option
. They do not share an interface, but this is a happy consequence of the consistent design and style of the Scala collections. You’ll discover how to retrieve a value defined for its left or right side. You’ll also inquire about its properties to check if a given instance is of type Left
or Right
and if it contains a value with specific features. You will use these operations to determine if your library has accepted a book-loaning request in the capstone.