Rule 72d-atexp-record
Atomic Expressions
(72)
TeX source
\defnrule[r:d-atexp-record]
{\opt{\jdg{E}{\exprow}{r}}}
{\jdg{E}{\kw{\kwlb}\ \opt{\exprow}\ \kw{\kwrb}}{\emptymap\opt{+\,r}}}Tests (11)
- elm / CharAstralRecordFieldTestAn astral `Char` (code point above 0xFFFF) in a record field keeps its code point, next to an `Int` field and after a record update, and a record holding one is equal to a record literal with the same fields.
- elm / CovLambdaSetFunctionsInRecordsTuplesAndMaybeTestFunctions stored in record fields, tuples and a `Maybe`, taken out again and applied.
- elm / EmbeddedMixedConstantsTestA record holding `Nothing`, `[]`, `True`, `""` and `()` returns each value unchanged when its field is read.
- elm / EmbeddedNothingInRecordTestA `Nothing` stored in a record field and read back with `.value` matches the `Nothing` pattern.
- elm / MinimalRecordTestA record expression with one field.
- elm / RecordAccessTestDot syntax reads fields of let-bound record literals.
- elm / RecordCreateTestRecord literals with `Int` and `String` fields print correctly through `Debug.log`.
- elm / RecordWithFunctionsTestFunctions stored in record fields can be called, composed and replaced with record update.
- elm / WideRecord33TestA record with 33 fields, cycling through `Int`, `Float`, `Char`, `String` and `Bool`, supports field access, record patterns, update, equality and printing.
- elm / WideRecord40TestA record with 40 fields, cycling through `Int`, `Float`, `Char`, `String` and `Bool`, supports field access, record patterns, update, equality and printing.
- elm / WideRecordPatternTestA record with 28 `Int` fields reads back correctly through field access, through a record pattern, and after a record update.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:d-atexp-record] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.