F# : A recursive value that can reference itself
问题 I have a record : type node = { content : string; parent : node option; branch : string option; children : seq<node> option; } Which I want to instantiate this way : let rec treeHead = { content = "Value" parent = None; branch = None; children = tree (Some(treeHead)) rows; }; Where let rec tree (parent:node option) (rows:seq<CsvRow>) :seq<node> option Is a a recursive function that gets the children of a node (to construct a tree). So as you can see the object treeHead needs to call itself