mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
🔥 bothOfThese
.
This commit is contained in:
parent
a33acf8bdf
commit
fd150be38e
@ -16,10 +16,6 @@ type Both a = Join (,) a
|
|||||||
both :: a -> a -> Both a
|
both :: a -> a -> Both a
|
||||||
both = curry Join
|
both = curry Join
|
||||||
|
|
||||||
-- | Construct Both with These values & defaults.
|
|
||||||
bothOfThese :: Both a -> These a a -> Both a
|
|
||||||
bothOfThese (Join a) = Join . uncurry fromThese a
|
|
||||||
|
|
||||||
-- | Construct Both (Maybe) with These values, defaulting to Nothing.
|
-- | Construct Both (Maybe) with These values, defaulting to Nothing.
|
||||||
maybeBothOfThese :: These a a -> Both (Maybe a)
|
maybeBothOfThese :: These a a -> Both (Maybe a)
|
||||||
maybeBothOfThese = Join . fromThese Nothing Nothing . bimap Just Just
|
maybeBothOfThese = Join . fromThese Nothing Nothing . bimap Just Just
|
||||||
|
Loading…
Reference in New Issue
Block a user