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:
parent
f7c4c91cfe
commit
25bae5d9e0
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user