frankshearar/zipr — Issue #1: Implement Either's either
Author: frankshearar
Created: 2011-12-07 14:32:37+00:00
State: open

A method that takes two Procs/Symbols and invokes one or the other, depending on Right/Leftness.

It turns
v = safe_down
case v
when Left then raise ZipperNavigationError.new(v.error)
when Right then v.value
end
into
safe_down.either(->r{r.value},
->l{raise ZipperNavigationError.new(l)})