Title here
Summary here
F# has various value types including strings, integers, floats, booleans, etc. Here are a few basic examples.
To run this program, save it as values.fs
and use the F# compiler (fsc
) to compile it, then run the resulting executable:
In this F# version:
printfn
for formatted printing, which is similar to printf
in other languages.+
operator, just like in the original example.&&
for AND, ||
for OR, and not
for negation.main
function in F# needs to return an integer exit code, which we’ve set to 0.F# is a functional-first language, so while this procedural style works, F# code often leverages functional programming concepts for more idiomatic and concise expressions.