Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- |Iterates two sorted lists at once.
- -- Concrete behavior is incapsulated in the supplied function. O(n)
- iter :: Ord a => ((Maybe a, Maybe a) -> [a] -> [a]) -> [a] -> [a] -> [a]
- iter f xs ys = foldr f [] (join (sort xs) (sort ys))
Advertisement
Add Comment
Please, Sign In to add comment