The [<StructuredFormatDisplay>]
attribute of the Disk
record is not correctly written (only a few dots appear in the console), when the Computer
record is printed with printfn "%A" myPc
. The output is:
Computer #1: Computers Inc./[...GB; ...GB; ...GB]
Is there anything else I need to say?
This is the code:
open System
[<StructuredFormatDisplay("{SizeGb}GB")>]
type Disk =
{ SizeGb : int }
[<StructuredFormatDisplay("Computer #{Id}: {Manufacturer}/{Disks}")>]
type Computer =
{ Id: int
[<BsonIgnore>] Ignore : string
Manufacturer: string
Disks: Disk list }
[<EntryPoint>]
let main argv =
let myPc =
{ Id = 1
Manufacturer = "Computers Inc."
Disks =
[ { SizeGb = 100 }
{ SizeGb = 250 }
{ SizeGb = 500 } ] }
printfn "%A" myPc
0 // return an integer exit code