title: Cross product of two lists
body: <p><em>Messing around with 'extension functions' for the List module. 
  (I spent quite a while developing 'mapfold' - which threads an accumulator like fold, but uses it as a parameter to create new values like map - then discovered that that is what <code>List.scan_left</code> does)</em></p>
  
  <p>For generation of test data, I needed to do a cross product of two lists, This is what I came up with:</p>
  
  <pre><code>///Perform cross product of two lists, return tuple
  let crossproduct l1 l2 =
      let product lst v2 = List.map (fun v1 -&gt; (v1, v2)) lst
      List.map_concat (product l1) l2
  </code></pre>
  
  <p>Is this any good, or is there already some better way to do this?</p>
  
  <p>Same question for this one:</p>
  
  <pre><code>///Perform cross product of three lists, return tuple
  let crossproduct3 l1 l2 l3 =
      let tuplelist = crossproduct l1 l2 //not sure this is the best way...
      let product3 lst2 v3 = List.map (fun (v1, v2) -&gt; (v1, v2, v3)) lst2
      List.map_concat (product3 tuplelist) l3
  </code></pre>