Skip to content

Instantly share code, notes, and snippets.

@merijn
Created Jun 12, 2015
Embed
What would you like to do?
dropAt
dropAt :: Int -> [a] -> [a]
dropAt = go id
where
go :: ([b] -> [b]) -> Int -> [b] -> [b]
go f n [] = f []
go f 0 (x:xs) = f xs
go f n (x:xs) = go (f . (x:)) (n-1) xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment