F# Interactive, is a REPL environment that lets you execute F# code, one line at a time.
If you have installed Visual Studio with F#, you can run F# Interactive in console by typing "C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\Fsi.exe"
. On Linux or OS X, the command is fsharpi
instead, which should be either in /usr/bin
or in /usr/local/bin
depending on how you installed F# -- either way, the command should be on your PATH
so you can just type fsharpi
.
Example of F# interactive usage:
> let i = 1 // fsi prompt, declare i
- let j = 2 // declare j
- i+j // compose expression
- ;; // execute commands
val i : int = 1 // fsi output started, this gives the value of i
val j : int = 2 // the value of j
val it : int = 3 // computed expression
> #quit;; //quit fsi
Use #help;;
for help
Please note the use of ;;
to tell the REPL to execute any previously-typed commands.