I do not find a way to compile a simple file (.fs) to a .exe. I tried this example and it does not work:
-
In the file dolphin.fs:
let longBeaked = "Delphinus capensis" let shortBeaked = "Delphinus delphis" let dolphins = [ longBeaked; shortBeaked ] printfn "Known Dolphins: %A" dolphins -
You can now compile this code to an EXE as shown here:
C:\fsharp> fsc dolphins.fs C:\fsharp> dir dolphins.exe
But when I do this an error occurs on the “:” from “C:\fsharp”
This seems a bit wrong – aside from the fact that you’re not supposed to type the first bit (as explained by svick), you probably also need to specify the full path to the F# compiler. If you’re using F# that comes with Visual Studio 2010, then you need:
If you’re using standalone installation of F#, then you’ll need to locate the F# compiler somewhere else (probably in “Program Files (x86)\FSharp-2.0.0.0”, but I’m not exactly sure). Also, I’m not sure what is the
dircommand supposed to do. To execute the compiled application (once it is compiled), you can just type: