diff --git a/src/Data/Bifunctor/These.hs b/src/Data/Bifunctor/These.hs index 935ee7012..da6aaa8e4 100644 --- a/src/Data/Bifunctor/These.hs +++ b/src/Data/Bifunctor/These.hs @@ -19,6 +19,8 @@ maybeFirst = these Just (const Nothing) ((Just .) . const) maybeSecond :: These a b -> Maybe b maybeSecond = these (const Nothing) Just ((Just .) . flip const) +swap :: These a b -> These b a +swap = these That This (flip These) -- Instances