module Data.Either.HT ( mapLeft, mapRight, mapBoth, maybeLeft, maybeRight, swap, ) where mapLeft :: (a -> b) -> Either a c -> Either b c mapLeft :: forall a b c. (a -> b) -> Either a c -> Either b c mapLeft a -> b f = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c either (forall a b. a -> Either a b Left forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> b f) forall a b. b -> Either a b Right mapRight :: (b -> c) -> Either a b -> Either a c mapRight :: forall b c a. (b -> c) -> Either a b -> Either a c mapRight b -> c f = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c either forall a b. a -> Either a b Left (forall a b. b -> Either a b Right forall b c a. (b -> c) -> (a -> b) -> a -> c . b -> c f) mapBoth :: (a -> c) -> (b -> d) -> Either a b -> Either c d mapBoth :: forall a c b d. (a -> c) -> (b -> d) -> Either a b -> Either c d mapBoth a -> c f b -> d g = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c either (forall a b. a -> Either a b Left forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> c f) (forall a b. b -> Either a b Right forall b c a. (b -> c) -> (a -> b) -> a -> c . b -> d g) maybeLeft :: Either a b -> Maybe a maybeLeft :: forall a b. Either a b -> Maybe a maybeLeft = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c either forall a. a -> Maybe a Just (forall a b. a -> b -> a const forall a. Maybe a Nothing) maybeRight :: Either a b -> Maybe b maybeRight :: forall a b. Either a b -> Maybe b maybeRight = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c either (forall a b. a -> b -> a const forall a. Maybe a Nothing) forall a. a -> Maybe a Just swap :: Either a b -> Either b a swap :: forall a b. Either a b -> Either b a swap = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c either forall a b. b -> Either a b Right forall a b. a -> Either a b Left