Skip to content

Add kind Row to Prim's Docs #3459

Description

@JordanMartinez

The best reference we have to a definition of Row is Record which is inaccurate because Rows are used in so many other places besides Records (e.g. Variant, type-level programming). I'd like to submit a PR that adds docs for it, but before I do, I want to discuss the best rendering for it. Here's my current rendering for Row:

Row is a kind for 0 or more label-type associations where the total number of these associations is known at compile time. A label can be used to refer to an instance of the associated type.

First, a row can be empty (there are no associations) or non-empty (there is at least one association). Second, it can be closed (the row contains only the label-type associations defined here) or open (the row contains at least, though it may contain more than, the label-type associations defined here). Third, it can contain duplicate 'labels'.

Examples:
Empty closed Row: ()
Empty open Row: ( | otherLabelTypeAssociations)
Non-empty closed Row: (label1 :: TypeName1, ... , labelN :: TypeNameN)
Non-empty open Row: (label1 :: TypeName1, ... , labelN :: TypeNameN | otherLabelTypeAssociations)
Duplicate Labels: (someLabel :: String, someLabel :: Int)

One open question I have. While rows can contain duplicate labels, can those labels associate different types? I'm assuming yes, but I'd like it clarified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions