title: formatting Composite function in f#
body: <p>I have a recursive function in f# that iterates a string[] of commands that need to be run, each command runs a new command to generate a map to be passed to the next function.</p>
  
  <p>The commands run correctly but are large and cumbersome to read, I believe that there is a better way to order / format these composite functions using pipe syntax however coming from c# as a lot of us do i for the life of me cannot seem to get it to work. </p>
  
  <p>my command is :</p>
  
  <pre><code> let rec iterateCommands (map:Map&lt;int,string array&gt;) commandPosition  = 
      if commandPosition &lt; commands.Length then
          match splitCommand(commands.[0]).[0] with
          |"comOne" -&gt; 
             iterateCommands (map.Add(commandPosition,create(splitCommand commands.[commandPosition])))(commandPosition+1)
  </code></pre>
  
  <p>The closest i have managed is by indenting the function but this is messy :</p>
  
  <pre><code>iterateCommands 
  (map.Add
      (commandPosition,create
          (splitCommand commands.[commandPosition])
      )
  ) 
  (commandPosition+1)
  </code></pre>
  
  <p>Is it even possible to reformat this in f#? From what i have read i believe it possible, any help would be greatly appreciated </p>
  
  <pre><code>The command/variable types are:
  commandPosition - int
  commands - string[]
  splitCommand string -&gt; string[]
  create string[] -&gt; string[]
  map : Map&lt;int,string[]&gt;
  </code></pre>
  
  <p>and of course the map.add map -> map + x</p>