F# type inference (compiler output)

f#, ide, type-inference

Solution

Assuming you have a file `test.fs`, you can use the following command to generate F# Signature File `test.fsi`, which contains type information about all top-level definitions:

Fsc.exe --sig:test.fsi test.fs

To get information about local variables, you'll need to use the F# compiler as a service. There is a simple command-line example that demonstrates how to call the API and you can also explore the F# binding for MonoDevelop.

Problem

Is there a way to get a structured output of the result of type inference by the F# compiler? (I am trying to build a small IDE).

Original source

Related problems