Skip to content

Instantly share code, notes, and snippets.

@dabd
Created June 30, 2014 02:10
Show Gist options
  • Select an option

  • Save dabd/7d520a0c35f8a4a0cb6a to your computer and use it in GitHub Desktop.

Select an option

Save dabd/7d520a0c35f8a4a0cb6a to your computer and use it in GitHub Desktop.
module Golf where
import Data.List
every n xs = case drop (n-1) xs of
(y:ys) -> y:every n ys
[] -> []
skips :: [a] -> [[a]]
skips xs = map (\n -> every n xs) [1..length xs]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment