Somewhere in my app I receive an Either ParserError MyParseResult
from Parsec. Downstream this result gets some other parsing done over using other libs. During tha
We have such a function in the standard libraries,
Control.Arrow.left :: a b c -> a (Either b d) (Either c d)
is the generalisation to arbitrary Arrows. Substitute (->)
for a
and apply it infix, to get the specialisation
left :: (b -> c) -> Either b d -> Either c d
There is nothing wrong with your approach in principle, it's a sensible way to handle the situation.