Bohtvaroh

Blogger - HTIF - iter

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