anchor.diff:  ///                     ... })
   ///
   /// Returns the exit code of the compile run.
  -let fsc
  -  (fscParamSetter: FscParams -> FscParams)
  -  (inputFiles: string list): int =
  -  let inputFiles = inputFiles |> Seq.toList
  -  let fscParams = fscParamSetter FscParams.Default
  -  let output = fscParams.Output
  -  let argList =
  -    if output <> "" then ["-o"; output] else []
  -    @ match fscParams.FscTarget with
  -      | Exe -> ["--target:exe"]
  -      | Winexe -> ["--target:winexe"]
  -      | Library -> ["-a"]
  -      | Module -> ["--target:module"]
  -    @ match fscParams.Platform with
  -      | X86 -> ["--platform:x86"]
  -      | Itanium -> ["--platform:itanium"]
  -      | X64 -> ["--platform:x64"]
  -      | AnyCpu32BitPreferred -> ["--platform:anycpu32bitpreferred"]
  -      | AnyCpu -> ["--platform:anycpu"]
  -    @ List.map (fun r -> "--reference:" + r) fscParams.References
  -    @ if fscParams.Debug then ["-g"] else []
  -    @ fscParams.OtherParams
  +let fsc (fscParamSetter : FscParams -> FscParams) (inputFiles : string list) : int = 
  +    let inputFiles = inputFiles |> Seq.toList
  +    let fscParams = fscParamSetter FscParams.Default
  +    let output = fscParams.Output
       
  -  traceStartTask "Fsc " (inputFiles |> separated ", ")
  -  let res = fscList inputFiles argList
  -  traceEndTask "Fsc " (inputFiles |> separated ", ")
  -  res
  +    let argList = 
  +        if output <> "" then [ "-o"; output ]
  +        else [] 
  +        @ match fscParams.FscTarget with
  +          | Exe -> [ "--target:exe" ]
  +          | Winexe -> [ "--target:winexe" ]
  +          | Library -> [ "-a" ]
  +          | Module -> [ "--target:module" ] 
  +          @ match fscParams.Platform with
  +            | X86 -> [ "--platform:x86" ]
  +            | Itanium -> [ "--platform:itanium" ]
  +            | X64 -> [ "--platform:x64" ]
  +            | AnyCpu32BitPreferred -> [ "--platform:anycpu32bitpreferred" ]
  +            | AnyCpu -> [ "--platform:anycpu" ] 
  +            @ List.map (fun r -> "--reference:" + r) fscParams.References @ if fscParams.Debug then [ "-g" ]
  +                                                                            else [] @ fscParams.OtherParams
  +    traceStartTask "Fsc " (inputFiles |> separated ", ")
  +    let res = fscList inputFiles argList
  +    traceEndTask "Fsc " (inputFiles |> separated ", ")
  +    res
   
   /// Compiles one or more F# source files with the specified parameters.
   /// Can be called as:
  
positive.code: ///   { parameters with Output = ...
  ///                     FscTarget = ...
  ///                     ... })
  let Fsc
    (fscParamSetter: FscParams -> FscParams)
    (inputFiles: string list): unit =
    let res = fsc fscParamSetter inputFiles
  
    if res <> 0
      then
        raise
          (Fake.MSBuildHelper.BuildException(
              "Fsc: compile failed with exit code"
            , [string res]))
    ()
  
negative.code: ﻿module Fake.FscHelper
  
  open Microsoft.FSharp.Compiler.SimpleSourceCodeServices
  
  let private scs = SimpleSourceCodeServices()
  
  /// 'fsc.exe' output target types
  type FscTarget = 
      | Exe
      | Winexe
      | Library
      | Module
  
  /// 'fsc.exe' output platforms
  type FscPlatform = 
      | X86
      | Itanium
      | X64
      | AnyCpu32BitPreferred
      | AnyCpu
  
  /// 'fsc.exe' command line parameters
  type FscParams = 
      { /// Specifies the output file name and path.
        Output : string
        /// Specifies the compiled artifact target type.
        FscTarget : FscTarget
        /// Specifies the compiled artifact target platform.
        Platform : FscPlatform
        /// Specifies files to reference for the compilation.
        References : string list
        /// Specifies whether to emit debug information (default is false).
        Debug : bool
        /// Specifies other params for the compilation. Freeform strings.
        OtherParams : string list }
      /// The default parameters to the compiler service.
      static member Default = 
          { Output = ""
            FscTarget = Exe
            Platform = AnyCpu
            References = []
            Debug = false
            OtherParams = [] }
  
  /// Compiles the given source file with the given options. If no options
  /// given (i.e. the second argument is an empty list), by default tries
  