Skip to content

Instantly share code, notes, and snippets.

@thejohnfreeman
Created December 5, 2015 17:53
Show Gist options
  • Select an option

  • Save thejohnfreeman/9afcf3c2144cbe7efc8b to your computer and use it in GitHub Desktop.

Select an option

Save thejohnfreeman/9afcf3c2144cbe7efc8b to your computer and use it in GitHub Desktop.
roundRobin :: Int -> [a] -> [[a]]
roundRobin n xs =
let (hs, ts) = splitAt n xs
in zipWith (:) hs (roundRobin n ts ++ repeat [])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment