Running Session Scripts with F#

I’m beginning to explore the F# language – some years ago I spent quite a bit of time working with a language named “APL” which was a very influential early functional language, wonderful to use partly because it had it’s own symbolic notation like mathematics does, more of this in some future posts though…

Anyway I’ve recently discovered (thanks to Vasily Kirichenko – here’s his blog) that I can dynamically monitor the state of an F# Interactive session within Visual Studio 2013 (I havent tried earlier version of VS).

After some digging I also found out that I can configure Visual Studio so that the necessary script loading steps needed for this can be done automatically by setting some options within Visual Studio 2013.

First download a suitable build of the utility from here and unzip the file – you should eventually see a file named FsEye.FSX – this is the script.

Next go to Visual Studio and bring up the Tools –> Options dialog pane, in there navigate the tree view looking for the node “F# Tools” then select the child node “F# Interactive”.

Next situate the mouse cursor into the text edit area for the “F# Interactive options” row and add the load directive along with the full path for your downloaded .FSX file, this is what it should look like (the 64-bit setting is unimportant and unrelated to this post):

image

Next exit Visual Studio, restart it and either load an existing F# project or start a new one and activate the F# Interactive session, you should see these messages in the session’s window:

image

This shows that the script loaded successfully.

Next create some simple value and the FS Eye window should appear and reveal the details of the created value:

image

image

As new values are added to the session FsEye automatically detects them and adds them to it’s window, very useful stuff especially for someone like me who is new to F# and needs to see as much helpful stuff as possible.

That’s it, enjoy!

This article is part of the GWB Archives. Original Author: Hugh Gleaves

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.