I was wondering how could I write a function in Haskell that interleaves a list of lists into a single lists, for example, if I had a function called
interleav
Simple recursive version:
inter :: [[a]] -> [a] inter [] = [] inter xs = inter2 (filter (\x -> not (null x)) xs) where inter2 xs = map head xs ++ inter (map tail xs)
Now, about foldr...