only :: (Integral nt) => nt -> [Bool]only n = [ x `mod` n == 0 | x <- [0..] ] each :: (Integral nt) => nt -> [a] -> [a]each n xs = [ snd x | x <- filter fst $ zip (only n) xs ] main = do print $ each 4 [1..50]
Standard input is empty
[1,5,9,13,17,21,25,29,33,37,41,45,49]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!