For example this record:
type City =
{
ID : string
Name : string
}
How can I create an F# AST for a record type definition programmatically?
open FSharp.Compiler.Syntax
open FSharp.Compiler.Text
module M =
let ty =
SynModuleDecl.CreateSimpleType( // something...
I later intend to print the AST using Fantomas.
I think this does what you want in F# 5:
The resulting syntax tree is: