Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2012 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4325580 to your computer and use it in GitHub Desktop.
Save anonymous/4325580 to your computer and use it in GitHub Desktop.
m-seq
user> (use 'clojure.algo.monads)
nil
user> (with-monad sequence-m (m-seq (list [1 2] [3 4])))
((1 3) (1 4) (2 3) (2 4))
user> (with-monad sequence-m (m-seq (list [1 2] [3 4] [5 6 7])))
((1 3 5) (1 3 6) (1 3 7) (1 4 5) (1 4 6) (1 4 7) (2 3 5) (2 3 6) (2 3 7) (2 4 5) (2 4 6) (2 4 7))
user>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment