Skip to content

Instantly share code, notes, and snippets.

@ldunn
Created September 20, 2010 06:35
Show Gist options
  • Select an option

  • Save ldunn/587501 to your computer and use it in GitHub Desktop.

Select an option

Save ldunn/587501 to your computer and use it in GitHub Desktop.
let generatePairs xs ys =
let pairs = ref []
for i in xs do
for j in ys do
if (List.filter (fun y -> ((y = [i;j]) || y = [j;i])) !pairs = []) then
printfn "%A" [i;j]
pairs := [i;j] :: !pairs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment