Content deleted Content added
→Versions: Adding F# 9 |
minor visual fix |
||
Line 377:
Age : int }
</syntaxhighlight>
Records can be created as {{code|lang=fsharp|code=let r = { Name="AB"; Age=42 } }}. The <code>with</code> keyword is used to create a copy of a record, as in {{code|lang=fsharp|code={ r with Name="CD"}}}, which creates a new record by copying <code>r</code> and changing the value of the <code>Name</code> field (assuming the record created in the last example was named <code>r</code>).
A [[tagged union|discriminated union]] type is a [[type-safe]] version of [[union (computer science)|C unions]]. For example,
|