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
5
votes
1 answer

Using reflection to determine whether an object needs its members to be invoked on the GUI thread

Referencing this FsEye issue, how can I use reflection to determine whether an object needs its members (or indeed a specific member if possible) to be invoked on the GUI thread? The scenario is this: a user creates an instance of a WebBrowser…
Stephen Swensen
  • 22,107
  • 9
  • 81
  • 136
4
votes
5 answers

Is fsi.exe an interpreter?

I've read that fsi.exe (F# Interactive) is not a true "interpreter" in the strict sense because it compiles F# code on the fly and displays its output. I am under the impression that the word "interpreter" applies to "dynamic" languages (i.e.…
The Internet
  • 7,959
  • 10
  • 54
  • 89
4
votes
1 answer

What does "namespace FSI_00XX" mean in FSharp Interactive?

Each time I load an FSX script file (or any other file for that matter) in FSharp Interactive in Visual Studio 2015, it prints a message: > #load "D:\Projects\Tests.fsx";; [Loading D:\Projects\Tests.fsx] namespace FSI_0055 It doesn't matter…
Abel
  • 56,041
  • 24
  • 146
  • 247
3
votes
1 answer

FSharpPlus : the fsi blocks when I try to combine two transformers

The fsi blocks when I try to combine these two transformers, without any warning or error message. open FSharpPlus open FSharpPlus.Data type MyError = | Err of string let f : WriterT>>> = monad { do! liftAsync…
Dwinky Doe
  • 31
  • 3
3
votes
1 answer

64 bit F# / FSI: Limitation of very large single file function

I have some chemical models, which are based on sparse matrices of some coefficients. So, given the model parameters, I generate F# code based on only non-zero elements of these coefficients. The generated model is then fed to ALGLIB…
3
votes
0 answers

Why does this code crash the second time it is executed in FSI?

I have some code that generates an exception the second time it is executed in FSI. The sequence is the following: 1) Select all lines above it, run on FSI using Alt+Enter. 2) Select the code, run on FSI using Alt+Enter. So far no errors. 3) Run…
Soldalma
  • 4,636
  • 3
  • 25
  • 38
3
votes
0 answers

Can I automatically open specific namespaces and libraries in F# Interactive REPL?

I notice that each time I open F# Interactive (FSI) from within Visual Studio to tryout something REPL-style, I always find myself executing a few commands first, often specific for any given project: open System;; #r…
Abel
  • 56,041
  • 24
  • 146
  • 247
3
votes
1 answer

Is it possible to trace the current line in an F# script with FSI library

We are using FSharp compiler service FSI evaluation session to execute a DSL. To be precise we are using F# code to simulate G-Code for a CNC machine. As each line of the FSI script moves the machine to a different location our users would like to…
bradgonesurfing
  • 30,949
  • 17
  • 114
  • 217
3
votes
2 answers

Can I get the inferred type of a value, without the contents, in F# Interactive?

When a value is created in the F# Interactive console the inferred type and contents of the value are displayed. How can I, at a later date, redisplay the inferred type without showing all the contents? For example, I have an array, mydata of 1000…
dommer
  • 19,610
  • 14
  • 75
  • 137
3
votes
0 answers

Mocking NLog4Net with NSubstitute and capturing parameters passed to log.ErrorFormat

Am trying to rewrite into F# the following C# which mocks up a Log4Net logger with NSubstitute and captures the parameters passed to a Log.ErrorFormat call into the _loggerException string. string _loggerException =…
Dave
  • 41
  • 2
3
votes
1 answer

How can I get the methods defined in a module?

I'm trying to consume an F# assembly from Fsi, but can't seem to find a way to get a list of methods defined in a module so I can call them. Here's a sample file I'm trying to do this with. In following the "exposing methods that are cross language…
Maslow
  • 18,464
  • 20
  • 106
  • 193
3
votes
0 answers

FSI and load order

in a.fsx : namespace na module ma = let var = 2 in b.fsx : #load "a.fsx" namespace nb module mb = let var = na.ma.var in c.fsx : #load "a.fsx" namespace nc module mc = let var = na.ma.var in userdep.fsx : #load "b.fsx" #load…
nicolas
  • 9,549
  • 3
  • 39
  • 83
2
votes
2 answers

F# interactive fails to load with "error FS0078: Unable to find the file 'System' in any of..."

I am running Fedora 16, which gives me mono 2.10.5, but no F#. I have previously used a locally compiled version of mono, but am now using the packaged version. I am using the latest version of F# from the github repository, installed to a local…
rneatherway
  • 553
  • 3
  • 11
2
votes
3 answers

Printfn value is not a function and cannot be applied in F#'s interactive window

This is probably something simple, but I have a .fs file with a simple sample function. let printHello = printfn "%A" "Hello" I have set the search path to the .fs file using >#I "PathToMyFSFile" I have loaded my file using >#load…
Chaitanya
  • 5,203
  • 8
  • 36
  • 61
2
votes
1 answer

FolderBrowserDialog not opening in fsharp script

I am having a simple script to select a folder, the process is not responding on call to ShowDialog(), below is script file, runtime config file and cli command to run, I think I’m missing something, or my understanding is wrong, test.fsx #I…