Handle a single error, by mapping it either to the success type
a or to one of the other errors in
errs.
This is syntactic sugar over using
VEither.
onLeft, but
can be nicer to use if one or only a few error variants need to be
handled, because it lets you build a simple pipeline:
>>> :{
examplePipe ve = ve
& VEither.handle @Int (pure . show)
& VEither.handle @Bool (pure . show)
:}
>>> :t examplePipe
examplePipe
:: VEither (Int : Bool : errs) String -> VEither errs String
>>> examplePipe (VEither.fromLeft False :: VEither '[Int, Bool, Float] String)
VRight "False"