11

GitHub - ronaldschlenker/PrettyFsi: Additions for working with F# Interactive, e...

 2 years ago
source link: https://github.com/ronaldschlenker/PrettyFsi
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

PrettyFsi

PrettyFsi is an F# Interactive table printer.

It's my contribution to the F# Advent Calendar, 11th Door, organized by Sergey Tihon - thank you very much for organizing this event :)

Important * PrettyFsi isn't a full-blown electric toy christmas present. It's more like a piece of chocolate in your advent calendar. * It's born from my daily needs. * I'm interested in other requirements and needs that could help, and there are quite a few TODOs. So feel free to raise an issue in case something doesn't work for you!

Usage

See also: demo.fsx

Bootstrap

#r "nuget: PrettyFsi"

open System
open PrettyFsi

PrettyFsi.addPrinters(fsi, TableMode.Implicit)

Print table of objects

type Test1 =
    { name: string
      degree: int
      weight: float
      birthDate: DateTime
      ids: int list }

[
    { name = "Hans Günther"
      degree = 23
      weight = 56.3
      birthDate = DateTime(2000, 12, 15, 23, 45, 00)
      ids = [ 1; 23; 45; 23; 556 ]
    }
    { name = "Jenny Lawrence"
      degree = 2
      weight = 56.3
      birthDate = DateTime(2000, 12, 15, 23, 45, 00)
      ids = [ 14; 63; 5; 8856 ]
    }
]

// result:
//
//       name              | degree  | weight  | birthDate            | ids                   | 
// ---------------------------------------------------------------------------------------------
// 0 :   "Hans Günther"    |     23  |   56.3  | 15.12.2000 23:45:00  | [1; 23; 45; 23; 556]  | 
// 1 :   "Jenny Lawrence"  |      2  |   56.3  | 15.12.2000 23:45:00  | [14; 63; 5; 8856]     | 

Build

See ./devDependeicies/README.md for instructions.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK