:: Either a b -> b package:either

Extracts the element out of a Right and throws an error if its argument take the form Left _. Using Control.Lens:
fromRight' x ≡ x^?!_Right
>>> fromRight' (Right 12)
12
Maybe get the Right side of an Either.
rightToMaybeeither (const Nothing) Just
Using Control.Lens:
rightToMaybe ≡ preview _Right
rightToMaybe x ≡ x^?_Right
>>> rightToMaybe (Left 12)
Nothing
>>> rightToMaybe (Right 12)
Just 12