JetBrains Rider 2021.3 Help

F# Interactive

To enable F# interactive on your computer:

Install Visual Studio Build Tools 2017 with F# compiler enabled on the Individual components tab. If you already have VS Build Tools or Visual Studio 2017, you can run the installer to modify the installation and choose to install F# compiler.

JetBrains Rider: F# compiler in Visual Studio Build Tools

Install the latest stable Mono: https://www.mono-project.com/download/stable/.

Install the fsharp package as described here: https://fsharp.org/use/linux/.

JetBrains Rider includes a Read–Eval–Print Loop (REPL), which lets you experiment with F# code without compiling it.

Start a new F# Interactive session

  • Select a block of code in the editor and press Ctrl+\ or alternatively, press Alt+Enter and then choose Send selection to F# interactive.

    JetBrains Rider will start a new interactive session in a new tab of the Run window and send the selected code to this session. If a F# interactive session is already running, the selected code will be appended to this session.

  • Choose Tools | F# Interactive | Start New F# Interactive Session from the menu.

    In this case, JetBrains Rider will open an empty interactive session and reset the current F# interactive session if it is already running. You can also clear the current session at any time by clicking Reset Icons actions restart on the toolbar.

As soon as the F# Interactive is started, you can write any F# expressions and evaluate them by pressing Enter.

JetBrains Rider: F# Interactive in action

F# Interactive will attempt to compile your code and execute it if successful. Otherwise the interpreter will return the error messages.

All expressions that you execute during the session are recorded in history. To find a previously executed statement, use the Up/Down buttons or copy any recently executed command:

JetBrains Rider: F# Interactive. Set recent command

To have the copied command executed at once, uncheck Copy recent commands to Interactive editor on the Languages and Frameworks | F# Interactive page of JetBrains Rider settings Ctrl+Alt+S.

Last modified: 07 April 2022