Dhall Repl: How to get the type of field of record type

380 views Asked by At

I'm looking for a way to see the type of field of a record type, basically a type-level equivalent of . in the Dhall REPL

Suppose I've done:

:let Person = { name : Text, age : Natural }

How would I find the type of Person.name (i.e. Text) without having to instantiate a Person?

If I create term of type Person, e.g. :let betty : Person = { age = 34, name = "Betty" }, I can do :type betty.name, but I'm looking for a type-level equivalent to that.

The practical use-case is for finding types of fields in dhall-kubernetes where there are deeply nested records with many fields.

Thanks, and apologies if my Google-fu failed and this has been asked before.

1

There are 1 answers

0
Gabriella Gonzalez On BEST ANSWER

The language does not support this yet, but I just opened an issue to track this idea:

https://github.com/dhall-lang/dhall-lang/issues/1079