2
votes

Using Python in command line you can write help(function) to see docstring. Is there something similar in Fsharp for fsi?

Do you have any tips and tricks for working in fsi anyway?

What is even possible to find out without using IDE? Just from interactive session.

EDIT: This question is actually addressed to Python guys who know Fsharp as well. I guess MS guys relying on their VS might find my question pretty strange :)

So far it seems that my question has simple answer: NO.

EXAMPLE: Lets say you are logged to remote computer via console. I dont know whether this is typical or even possible scenario. For some reason I started fsi and now what? Am I lost or do I have some chances to get some help from fsi directly

DISCLAMER: I know Scott Wlaschins fsharpforfunandprofit.com pretty well. But his example is dedicated to C# users. Pythonists have different workflow.

2
Can you clarify - you would like to only use FSI, no IDE of any sort? - Anton Schwaighofer
I started to write an answer for this but this question is so open that it is hard to give a helpful answer. These might help. Visual Studio Intellisense, Visual Studio Object Browser, or NuGet - Guy Coder
Basically you have to change the way you think from Python with duck typing to F# with static typing, .Net Library, F# core, and extensions. - Guy Coder
Also, this SO thread on F# interactive autocomplete could be helpful. - Anton Schwaighofer
The short answer is no. If you need quick help from the console, PowerShell's Get-Member could work in a pinch. - Daniel

2 Answers

2
votes

If you are used to interactive python, and you like the approach, you may have a look at this F# engine for iPython Notebook:

https://github.com/fsprojects/IfSharp

0
votes

Yes.

Simple introspection can be done by typeof <_> or typedefof<_>.

For example:

typeof<System.Console>;;

In fsi you can use TAB completation, but apperantly just from command line. It is not working in my Xamarin.

Neat trick is to run:

fsi --use:yourfile.fsx

which run your file and let you test it interactively.

For more info you can use in command line fsi.exe --help.