Last active
August 29, 2015 14:06
-
-
Save Rydgel/9c9ce1eced0ab4015e23 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Golf where | |
| skips :: [a] -> [[a]] | |
| skips xs = map (\(i,x) -> takeNth i x) $ zipWith (\_ b -> (b, xs)) xs [1..] | |
| takeNth :: Int -> [a] -> [a] | |
| takeNth n xs = [y | (i,y) <- zip [1..] xs, i `mod` n == 0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment