fork download
  1. only :: (Integral nt) => nt -> [Bool]
  2. only n = [ x `mod` n == 0 | x <- [0..] ]
  3.  
  4. each :: (Integral nt) => nt -> [a] -> [a]
  5. each n xs = [ snd x | x <- filter fst $ zip (only n) xs ]
  6.  
  7. main = do print $ each 4 [1..50]
Success #stdin #stdout 0.01s 3548KB
stdin
Standard input is empty
stdout
[1,5,9,13,17,21,25,29,33,37,41,45,49]