Skip to content

t function for types information #2

@lontivero

Description

@lontivero

It would be a dream to have also a t function to see a type properties. For record types for example something like this:

Silly code to explain the request
let t<'x> () = typeof<'x>.GetProperties()
                |> Seq.map (fun p -> p.Name, p.PropertyType.Name) 
                |> Seq.map (fun (n, t) -> $"    {n}: {t}") 
                |> String.concat "\n" |> fun s -> $"{{\n{s} }}";;
> t<System.Index>();;
val it: string =
  "{
    Start: Index
    End: Index
    Value: Int32
    IsFromEnd: Boolean }"

> t<Nostra.Event>();;
val it: string =
  "{
    Id: EventId
    PubKey: Author
    CreatedAt: DateTime
    Kind: Kind
    Tags: FSharpList`1
    Content: String
    Signature: SchnorrSignature }"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions