Skip to content

Instantly share code, notes, and snippets.

@echojc
Created May 25, 2013 12:14
Show Gist options
  • Select an option

  • Save echojc/5648888 to your computer and use it in GitHub Desktop.

Select an option

Save echojc/5648888 to your computer and use it in GitHub Desktop.
transpose :: [[a]] -> [a]
transpose [] = []
transpose input = map head input ++
transpose (filter (not . null) (map tail input))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment