1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Simplify bothOfThese around fromThese.

This commit is contained in:
Rob Rix 2016-04-04 15:38:07 -04:00
parent f7c4c91cfe
commit 25bae5d9e0

View File

@ -18,7 +18,7 @@ both = curry Join
-- | Construct Both with These values & defaults.
bothOfThese :: Both a -> These a a -> Both a
bothOfThese a = these (`both` snd a) (both (fst a)) both
bothOfThese (Join a) = Join . uncurry fromThese a
-- | Construct Both (Maybe) with These values, defaulting to Nothing.
maybeBothOfThese :: These a a -> Both (Maybe a)