summaryrefslogtreecommitdiff
path: root/11-20/16.hs
blob: 74cc946b5a401a5aadf848240ddb9226f55a7cd5 (plain) (blame)
1
2
3
4
5
6
7
dropEvery :: [a] -> Int -> [a]

dropEvery l n = d l 1
    where d [] i = []
          d (x:xs) i
            | i == n = d xs 1
            | otherwise = x:d xs (i + 1)