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
I don't have anything to test this with at work, but something like:
extractEvery m = map snd . filter (\(x,y) -> (mod x m) == 0) . zip [1..]
should work even on infinite lists.
(Edit: tested and corrected.)