More specifically, how do I generate a new list of every Nth element from an existing infinite list?
E.g. if the list is [5, 3, 0, 1, 8, 0, 3, 4, 0, 93, 211, 0
[5, 3, 0, 1, 8, 0, 3, 4, 0, 93, 211, 0
My solution is:
every :: Int -> [a] -> [[a]] every _ [] = [] every n list = take n list : (every n $ drop n list)
It do not use zip but I can't tell about it's performances and memory profile.