Skip to content

Instantly share code, notes, and snippets.

@supki
Last active December 5, 2017 21:01
Show Gist options
  • Select an option

  • Save supki/4643955 to your computer and use it in GitHub Desktop.

Select an option

Save supki/4643955 to your computer and use it in GitHub Desktop.
Lists cartesian product oneliner in python.
from os import popen
def f(xs):
return eval(popen("""ghc -ignore-dot-ghci -e "sequence %s" """ % xs).read())
@dmalikov
Copy link

Much better than itertools.product 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment