185 people like it.

Hello world (F#)

Classical "Hello world" example that prints a message to the console output. This version uses F# printfn function to do the printing.

1: 
2: 
3: 
4: 
5: 
// Declare a local value (inferred type is string)
let world = "world"

// Using '%s' format specifier to include string parameter
printfn "Hello %s!" world
val world : string

Full name: Script.world
val printfn : format:Printf.TextWriterFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
Next Version Raw view Test code New version

More information

Link:http://fssnip.net/q
Posted:13 years ago
Author:Tomas Petricek
Tags: printf , hello world , let