mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
🔥 bothOfThese
.
This commit is contained in:
parent
8be4e9bc83
commit
693f91b93c
@ -12,10 +12,6 @@ newtype Both a = Both { runBoth :: (a, a) }
|
|||||||
both :: a -> a -> Both a
|
both :: a -> a -> Both a
|
||||||
both = curry Both
|
both = curry Both
|
||||||
|
|
||||||
-- | Construct Both with These values & defaults.
|
|
||||||
bothOfThese :: Both a -> These a a -> Both a
|
|
||||||
bothOfThese a = these (`both` snd a) (both (fst a)) both
|
|
||||||
|
|
||||||
-- | Apply a function to `Both` sides of a computation.
|
-- | Apply a function to `Both` sides of a computation.
|
||||||
runBothWith :: (a -> a -> b) -> Both a -> b
|
runBothWith :: (a -> a -> b) -> Both a -> b
|
||||||
runBothWith f = uncurry f . runBoth
|
runBothWith f = uncurry f . runBoth
|
||||||
|
Loading…
Reference in New Issue
Block a user