title: F# output a list to a file
body: <p>I am a student learning F# and at the moment am attempting to output a list to a file created from analysis through a clustering algorithm. I think I am close but I am getting the error message from the second elem: "The type 'int list' is not compatible with any of the types byte,int16,int32,int64,sbyte,uint16,uint32,uint64,nativeint,unativeint, arising from the use of a printf-style format string" Here is my code:</p>
  
  <pre><code>let printNumbersToFile fileName =
     use file = System.IO.File.CreateText(fileName)
     clusteredIds
     |&gt; List.iter (fun elem -&gt; fprintf file "%d " elem)
     fprintfn file ""
  printNumbersToFile "C:\Users\Jessica\Desktop\CTU Stuff\Dissertation\Programs For Dissertation\Fsharp\DensityClustering\Test.csv"
  </code></pre>
  
  <p>Any help would be greatly appreciated. Thank you in advance.</p>