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:
parent
3a36d67245
commit
8260c08cdd
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user