-->

F# - Keep F# interactive from posting output

2020-02-10 05:17发布

问题:

I'm working with F# interactive and I'm computing some large lists and arrays and I'd rather not have the interactive window post all of that information. Is there way to suppress output?

Specifically I'm developing single threaded and multithreaded algorithms and evaluating at what point does it become more efficient to change from a single threaded function to a multithreaded one. I'd like to have F# Interactive report the run time for the functions, I've been using #time, but I don't want to have to scroll way back up when it prints the large matrix of data to the screen. If there is a way to just get the timing data while keeping the interactive environment from writing out the matrix I would be very appreciative.

回答1:

I ended up using

fsi.ShowDeclarationValues <- false

Which kept it from outputting all of the data. Thank you for the tips though.



回答2:

Check out

http://blogs.msdn.com/b/dsyme/archive/2010/01/08/some-tips-and-tricks-for-formatting-data-in-f-interactive-and-a-in-sprintf-printf-fprintf.aspx

for some suggestions that may be relevant.