Left package:essence-of-live-coding

Feed marked inputs through the argument arrow, passing the rest through unchanged to the output.
Laws:
left'dimap swapE swapE . right' where
swapE :: Either a b -> Either b a
swapE = either Right Left
rmap Leftlmap Left . left'
lmap (right f) . left'rmap (right f) . left'
left' . left'dimap assocE unassocE . left' where
assocE :: Either (Either a b) c -> Either a (Either b c)
assocE (Left (Left a)) = Left a
assocE (Left (Right b)) = Right (Left b)
assocE (Right c) = Right (Right c)
unassocE :: Either a (Either b c) -> Either (Either a b) c
unassocE (Left a) = Left (Left a)
unassocE (Right (Left b)) = Left (Right b)
unassocE (Right (Right c)) = Right c
Any instance of ArrowApply can be made into an instance of ArrowChoice by defining left = leftApp.
Laws:
unleftunright . dimap swapE swapE where
swapE :: Either a b -> Either b a
swapE = either Right Left
rmap (either id absurd) ≡ unleft . lmap (either id absurd)
unfirst . rmap (second f) ≡ unfirst . lmap (second f)
unleft . unleftunleft . dimap assocE unassocE where
assocE :: Either (Either a b) c -> Either a (Either b c)
assocE (Left (Left a)) = Left a
assocE (Left (Right b)) = Right (Left b)
assocE (Right c) = Right (Right c)
unassocE :: Either a (Either b c) -> Either (Either a b) c
unassocE (Left a) = Left (Left a)
unassocE (Right (Left b)) = Left (Right b)
unassocE (Right (Right c)) = Right c