Questions tagged [fsi]

fsi is the REPL (read-eval-print-loop) for the F# programming language.

fsi is the REPL (read-eval-print-loop) for the F# programming language.

fsi can either mean standalone console application or F# Interactive embedded in Visual Studio , that allow you to interactively send F# commands that are subsequently compiled and executed. The interface then replies with the type signature and result values, if any.

After which you are presented with a prompt and can start all over again (previously defined functions and variables are retained until you reset the session).

This is a good way to spike functions or do exploratory development.

MSDN info: http://msdn.microsoft.com/en-us/library/dd233175.aspx

81 questions
2
votes
4 answers

Does FSI deal well with multi module F# projects?

Does FSI deal well with multi module/file F# projects? Consider the following project: module.fs: module Xyz let add x y = x + y Program.fs: module Program open Xyz let result = add 1 2 selecting and running the last 2 lines of Program.fs…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
2
votes
2 answers

F# unbox returns obj

Perhaps a silly question, but why does the return value from unbox appear (in my F# Interactive session) to be typed as obj instead of the concrete type int? As far as I can understand (trying to apply existing knowledge from C#) if it's typed as…
Jono
  • 1,964
  • 4
  • 18
  • 35
2
votes
1 answer

Bind variable to interface type in FSI

I'm experimenting with integration of F# as scripting language and have an issue with FsiEvaluationSession.AddBoundVariable method. Problem is that this method creates variable of actual type of object, but I need to create variable of interface…
JL0PD
  • 3,698
  • 2
  • 15
  • 23
2
votes
0 answers

How to copy to the clipboard in F#, specifically dotnet core fsi?

I want to set text to the clipboard in my fsi script in dotnet core. I have used the below code from the question in the link below, which has served me well for years. How would I do the equivalent in dotnet core / dotnet 5? open…
slavs
  • 108
  • 1
  • 7
2
votes
0 answers

F# Interactive #I Generic Nuget Directory

I have an F# script referencing a package in %USERPROFILE%\.nuget\packages FSI is happy with #I @"C:\Users\Username\.nuget\packages" but not #I @"%USERPROFILE%\.nuget\packages" How can the #I path be the nuget packages directory for the current…
Brett Rowberry
  • 1,030
  • 8
  • 21
2
votes
1 answer

F# interactive session persistance and other such user questions

Is there any way of persisting my F# session or serializing it into a file? i.e. so I can hand it to a friend and say "run this" and they will be at the same place I was? I know forth had this ability but I can't find any way of doing this. An…
Snark
  • 1,664
  • 14
  • 27
2
votes
1 answer

Is there a reference for fsi.commands?

I'm trying to quiet down the F# Interactive terminal in VS Code. In my search I ran into commands such as fsi.ShowDeclarationVariables <- false, but I haven't found documentation of all such commands available. Can anyone point me in the right…
Bob McCrory
  • 183
  • 1
  • 3
2
votes
2 answers

Can I use FSI to debug my code?

Is there a way to run my .fs file with either a breakpoint or a command like System.Diagnostics.Debugger.Launch() in it so that I can use FSI to examine values, apply functions to them, plot them, etc.? I know this question has been asked before but…
Soldalma
  • 4,636
  • 3
  • 25
  • 38
2
votes
2 answers

FSharp Interactive won't start; can't find System.Runtime.dll

I've installed FSharp 4.1 through the Visual Studio 2017 installer, but FSI refuses to start: PS C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0> .\fsi Unhandled Exception: System.IO.FileNotFoundException: Could not load file or…
Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402
2
votes
0 answers

F# / Ionide in Visual Studio Code, max script length to FSI?

I am having a problem sending F# scripts to F# Interactive using Ionide in Visual Studio Code. I am using the "FSI: Send Selection" command using Alt+Enter. This works fine for smaller scripts, but with script length exceeds a certain limit (approx…
Joe
  • 21
  • 1
2
votes
0 answers

referencing com interface in fsi F# interactive

I'm trying to rewrite this matlab .Net example in F# interactive. In the example a COM-interface reference is used. How do I reference a COM-interface from within the fsi? EDIT I refence the as described From the Project menu, select Add…
Peter Siebke
  • 196
  • 1
  • 8
2
votes
0 answers

How do do fsi settings in Visual Studio Code to prevent print out

I am using lonide for f# with Visual Studio Code. I would like to prevent the FSI output window to print out the defined code and variables. I learned that this can be done with a setting like this: fsi.ShowDeclarationValues <- false The question…
silverfighter
  • 6,762
  • 10
  • 46
  • 73
2
votes
0 answers

Launching WPF Window from F# interactive, keyboard input broken

A GUI was developed in WPF, and when launching it as a standalone application, all editable fields (datagrid columns, textboxes, etc.) work fine. However, when instantiating the window from FSI, no individual key characters are registered when…
odkken
  • 329
  • 1
  • 9
2
votes
1 answer

F# ignore missing ignore

I am using F# often in a interactive way. I type statements in a script file in Visual Studio and press Alt + Enter to execute them in F# Interactive. Very often I see the warning that I am ignoring the result of an expression. Of course I'm not,…
itmuckel
  • 1,300
  • 15
  • 23
2
votes
1 answer

F# interactive in Visual Studio 2015 may ignore DLL include path

I have a list of DLL load instructions that looks like this: #I __SOURCE_DIRECTORY__ #r @"packages\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll" #r @"packages\Akka\lib\net45\Akka.dll" ... Note that the list references Newtonsoft.Json.dll (the…
Vagif Abilov
  • 9,835
  • 8
  • 55
  • 100