1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 14:54:16 +03:00

Add a swap function to flip These.

This commit is contained in:
Rob Rix 2016-03-14 20:18:53 -04:00
parent 3a36d67245
commit 8260c08cdd

View File

@ -19,6 +19,8 @@ maybeFirst = these Just (const Nothing) ((Just .) . const)
maybeSecond :: These a b -> Maybe b maybeSecond :: These a b -> Maybe b
maybeSecond = these (const Nothing) Just ((Just .) . flip const) maybeSecond = these (const Nothing) Just ((Just .) . flip const)
swap :: These a b -> These b a
swap = these That This (flip These)
-- Instances -- Instances