Cartesian product of two or more lists: Difference between revisions
Content added Content deleted
(Add Swift) |
|||
Line 642: | Line 642: | ||
<lang fsharp> |
<lang fsharp> |
||
//Nigel Galloway August 14th., 2018 |
//Nigel Galloway August 14th., 2018 |
||
let cP ng= |
let cP ng=Seq.foldBack(fun n g->[for n' in n do for g' in g do yield n'::g']) ng [[]] |
||
</lang> |
</lang> |
||
{{out}} |
{{out}} |