Skip to content

Instantly share code, notes, and snippets.

@iporsut
Created May 13, 2015 15:54
Show Gist options
  • Save iporsut/5e3b29029cae1ff57a1e to your computer and use it in GitHub Desktop.
Save iporsut/5e3b29029cae1ff57a1e to your computer and use it in GitHub Desktop.
rotate
rotate xs n | n >= 0 = drop n xs ++ take n xs
| otherwise = drop (length xs + n) xs ++ take (length xs + n) xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment