mirror of
https://github.com/github/semantic.git
synced 2024-12-23 06:41:45 +03:00
Add runBothWith.
This commit is contained in:
parent
7548e148dc
commit
51ad3ba049
@ -11,6 +11,10 @@ newtype Both a = Both { runBoth :: (a, a) }
|
||||
both :: a -> a -> Both a
|
||||
both = curry Both
|
||||
|
||||
-- | Apply a function to `Both` sides of a computation.
|
||||
runBothWith :: (a -> a -> b) -> Both a -> b
|
||||
runBothWith f = uncurry f . runBoth
|
||||
|
||||
-- | Runs the left side of a `Both`.
|
||||
fst :: Both a -> a
|
||||
fst = Prelude.fst . runBoth
|
||||
|
Loading…
Reference in New Issue
Block a user