Closed LiamGoodacre closed 7 years ago
With this I think we could remove support of closed records from generics-rep deriving 👍 - so that generics-rep only describes data constructors and their positional arguments.
This would also let us define Show
for records with closed rows.
A type class
RowLabels
to compute the list of labels in a closed row. Defined as:Where
LabelList
is defined by:The labels computed by
RowLabels
should be sorted and preserve duplicates, e.g:With this it is possible to compute a lot more based on rows. We can check if a row has a label, filter labels, rebuild a row with the associated types transformed in some way, perhaps reflect the list as an array of strings.
Any thoughts, ideas, criticism?