Skip to content

Instantly share code, notes, and snippets.

@Leonidas-from-XIV
Created February 27, 2014 21:54
Show Gist options
  • Select an option

  • Save Leonidas-from-XIV/9260414 to your computer and use it in GitHub Desktop.

Select an option

Save Leonidas-from-XIV/9260414 to your computer and use it in GitHub Desktop.
breakNth _ [] = ([], [])
breakNth n lat = case splitAt (n-2) lat of
(skipped,r:rs) -> let (skipped', rest) = breakNth n rs in
(skipped ++ skipped', x:r:rest)
(skipped, []) -> (skipped, x:[])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment