The Either
effect is similar to the Option
effect but adds the possibility to specify why a computation stopped:
`> (Right(30),Left(‘missing’ not found))`
Note: the *
syntax comes from the kind-projector
project and allows us to avoid type lambdas.
A catchLeft
method can also be used to intercept an
error and possibly recover from it:``
Note: the type annotations on left
and
right
can be avoided by adding an implicit declaration in
scope. You can learn more about this in the
Implicits
section.