F# Tutorial - Hello World in 10 minutes

Write some code

Open Program.fs in any text editor, and replace all of the code with the following. If you want to, you can replace the name Ana with your name.

open System

// Define a new function to print a name.
// It must be defined before it is called in the main function.
let printGreeting name =
    printfn "Hello %s from F#!" name

let main argv =
    // Call your new function!
    printGreeting "Ana"
    0 // return an integer exit code

Save the Program.fs file, and run your code again.

Command prompt
dotnet run