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
40
votes
9 answers

C# REPL outside Visual Studio

F# has a REPL (read–eval–print loop) F# Interactive, C:\Program Files (x86)\Microsoft F#\v4.0\Fsi.exe. I understand C# now has its own interactive REPL, as released with Roslyn. How do I open outside Visual Studio? Where is csi.exe?
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
29
votes
11 answers

How to Display VS Code output window to side rather than below

In my VS Code set up I see the output/FSI frame below the main text editor pane like this: whereas I would love it to appear to the right in the side-by-side view like it does on the images in this link:…
Stewart_R
  • 13,764
  • 11
  • 60
  • 106
13
votes
1 answer

Is there a way to restart FSI in Visual Studio?

I'm learning F#, and keep accidentally writing infinitely recursive functions.. When I call these in F# Interactive (FSI) through Visual Studio (2010 or 2012), I can't find a way to get out of it other than to restart Visual Studio. Is there any…
Grant Crofton
  • 8,895
  • 5
  • 28
  • 38
11
votes
1 answer

How to use FSharpChart from fsx script file

I want to use FSharpChart with a fsx script file in my project. I downloaded and referenced the MSDN.FSharpChart.dll using Nuget and my code looks like this #r @"..\packages\MSDN.FSharpChart.dll.0.60\lib\MSDN.FSharpChart.dll" open…
Igor Kulman
  • 16,211
  • 10
  • 57
  • 118
10
votes
1 answer

fsx script referencing a dll referencing many dll

What kind of strategy do I have for the following problem. I want to use a simple class inside a dll, which has link to various dlls, of various versions etc. As a fsx file, my script show no error. but upon running it in fsharp interactive, it…
nicolas
  • 9,549
  • 3
  • 39
  • 83
8
votes
1 answer

why does F# failwith return a generic type rather than Exception type

According to the docs the failwith function returns an Exception But the function signature is string -> 'a Why is the signature not string -> Exception ?
OrdinaryOrange
  • 2,420
  • 1
  • 16
  • 25
8
votes
1 answer

F# - card suits not displaying in console

I'm making console based card game in f# and I'm struggling with displaying card suits using unicode chars. Mapping suit-to-char is represented as following function: let suitSymbol = function | Spades -> "\u2660" | Clubs -> "\u2663" …
Muchtrix
  • 83
  • 4
8
votes
1 answer

Run f# script with parameters

I try to run f# script using fsi.exe via batch file CALL "path\fsi.exe" --quiet --exec --use:"path\FindAndDelete.fsx" arg1 arg2 arg3 I need my script program operate with arg1 arg2 and arg3. But the command: for arg in…
Olexiy Pyvovarov
  • 870
  • 2
  • 17
  • 32
7
votes
1 answer

How do I add a pretty printer for a generic type to fsi?

In F# Interactive (fsi), you can use AddPrinter or AddPrinterTransformer to provide pretty printing for a type in the interactive session. How can I add such a printer for a generic type? Using the wildcard _ for the type doesn't work: >…
Jeffrey Sax
  • 10,253
  • 3
  • 29
  • 40
6
votes
1 answer

Character/line limit when pasting in vscode terminal

I have a problem when using Fsi in VSCode. I've been having this issue since 1.7 and it persists in the current releases of 1.8. If I use alt + enter to send a code selection to VSCode it works, but only for short selections. When the selection is…
CodeMonkey
  • 4,067
  • 1
  • 31
  • 43
5
votes
3 answers

C# Interactive Location

I use F# Interactive every day, so I like launching it from cmd, not just Visual Studio and Visual Studio Code. To do that, I have an environment variable called FSHARPINSTALLDIR in my PATH that points to C:\Program Files (x86)\Microsoft Visual…
Brett Rowberry
  • 1,030
  • 8
  • 21
5
votes
1 answer

How do I display a Deedle DataFrame as a nice table in FSI?

Reading the article Analyzing and Visualizing Data with F# (https://www.oreilly.com/ideas/analyzing-and-visualizing-data-with-f-sharp/page/2/analyzing-data-using-f-and-deedle) I gathered (perhaps incorrectly) that one could display the contents of a…
Soldalma
  • 4,636
  • 3
  • 25
  • 38
5
votes
1 answer

Defining my own preprocessor directives in F#

I have an F# script that I intend to use both at home and at work. The script shall work similarly in both places, yet, I have a set of issues to deal with at work (mostly regarding firewalls and http proxies) so I'd like to run my script in a…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
5
votes
0 answers

Authenticated http request fails in FSI only

I'm making an authenticated request like this: let url = "https://datafeeds.networkrail.co.uk/ntrod/CifFileAuthenticate?type=CIF_ALL_FULL_DAILY&day=toc-full" let auth = "Basic " + (username + ":" + password |> Encoding.UTF8.GetBytes |>…
Gustavo Guerra
  • 5,319
  • 24
  • 42
5
votes
1 answer

How do I add a reference in fsharpi that has a version and public key in Mono

The following #r command will execute fine on Windows #r "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" On Osx with Mono 3.0.6 it cant find the file even though the file is in the search path. Im guessing that this…
7sharp9
  • 2,147
  • 16
  • 27
1
2 3 4 5 6