mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
🔥 zipDefaults
.
This commit is contained in:
parent
693f91b93c
commit
cd844d7a00
@ -27,10 +27,6 @@ snd = Prelude.snd . runBoth
|
||||
zip :: Both [a] -> [Both a]
|
||||
zip = zipWith both
|
||||
|
||||
-- | Zip Both lists, using the default values to extend the shorter list.
|
||||
zipDefaults :: Both a -> Both [a] -> [Both a]
|
||||
zipDefaults ds as = take (runBothWith max (length <$> as)) $ zipWith both ((++) <$> as <*> (repeat <$> ds))
|
||||
|
||||
zipWith :: (a -> a -> b) -> Both [a] -> [b]
|
||||
zipWith _ (Both ([], _)) = []
|
||||
zipWith _ (Both (_, [])) = []
|
||||
|
Loading…
Reference in New Issue
Block a user