Skip to content

Instantly share code, notes, and snippets.

@SamWhited
Created March 6, 2012 04:49
Show Gist options
  • Save SamWhited/1983646 to your computer and use it in GitHub Desktop.
Save SamWhited/1983646 to your computer and use it in GitHub Desktop.
Simple list flattening
(i for i in s for s in l)
[i for s in l for i in s]
# Assuming we can't use `arr.flatten` for some reason:
l.reduce(:+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment