This package provides a colored and tabularized thread-safe output for sequences of named or anonymous records.
(Colors not visible in markdown.)
#r "nuget: SeqPrinter, 0.4.0"
open SeqPrinterdotnet add package SeqPrinter --version 0.4.0type Person = { Name: string; Age: int; Height: int }
let typedList =
[
{
Name = "Stanley"
Age = 32
Height = 175
}
{
Name = "Akira"
Age = 27
Height = 175
}
{
Name = "Andrei"
Age = 35
Height = 200
}
]
typedList |> Printer.print Age Height Name
<Int32> <Int32> <String>
32 175 Stanley
27 175 Akira
35 200 Andrei
Displaying 1-3 of 3 items.
You can select which fields of your type to display as columns.
typedList
|> Printer
|> Printer.withColumns [ "Name"; "Height" ]
|> Printer.print Name Height
<String> <Int32>
Stanley 175
Akira 175
Andrei 200
Displaying 1-3 of 3 items.
Similarly you can also determine the order of fields to display.
typedList
|> Printer
|> Printer.withColumns [ "Name"; "Age"; "Height" ]
|> Printer.print Name Age Height
<String> <Int32> <Int32>
Stanley 32 175
Akira 27 175
Andrei 35 200
Displaying 1-3 of 3 items.
let printer =
typedList
|> List.replicate 25
|> List.concat
|> Printer
|> Printer.withPageSize 10 Age Height Name
<Int32> <Int32> <String>
32 175 Stanley
27 175 Akira
35 200 Andrei
32 175 Stanley
27 175 Akira
35 200 Andrei
32 175 Stanley
27 175 Akira
35 200 Andrei
32 175 Stanley
Displaying 1-10 of 75 items.
printer
|>Printer.nextPage
// Alternative
printer.NextPage() Age Height Name
<Int32> <Int32> <String>
27 175 Akira
35 200 Andrei
32 175 Stanley
27 175 Akira
35 200 Andrei
32 175 Stanley
27 175 Akira
35 200 Andrei
32 175 Stanley
27 175 Akira
Displaying 11-20 of 75 items.