Skip to content

imply record labels from expressions #653

Open
@dsyme

Description

@dsyme

I propose we allow both records and anonymous records to imply record labels from a limited range of expressions, e.g. for anonymous records:

{| x.Name; x.Title |}

is the same as

{| Name=x.Name; Title=x.Title |}

The same would apply for records. The label names would be implied by a expr.Name lookup only.

It would be natural to do this at the same time as anonymous records.

The existing way of approaching this problem in F# is to write the label names explicitly.

Pros and Cons

The advantages of making this adjustment to F# are succinctness

The disadvantages of making this adjustment to F# are you have to know the rule, and it makes the selection of type a little more implicit, especially in the case of records.

Extra information

Estimated cost (XS, S, M, L, XL, XXL): M

Related suggestions: #207

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions