mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
Add runLeft/runRight conveniences.
This commit is contained in:
parent
acd19b4502
commit
acca5d8917
@ -10,6 +10,14 @@ newtype Both a = Both { runBoth :: (a, a) }
|
||||
both :: a -> a -> Both a
|
||||
both = curry Both
|
||||
|
||||
-- | Runs the left side of a `Both`.
|
||||
runLeft :: Both a -> a
|
||||
runLeft = fst . runBoth
|
||||
|
||||
-- | Runs the right side of a `Both`.
|
||||
runRight :: Both a -> a
|
||||
runRight = snd . runBoth
|
||||
|
||||
zip :: Both [a] -> [Both a]
|
||||
zip = zipWith both
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user