Skip to content

Commit 44ada92

Browse files
BebeSparkelSparkelhdgarrood
authored andcommitted
record update function (#261)
* record update function * no monads
1 parent 8a4017b commit 44ada92

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

language/Records.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ setPersonPostcode :: PostCode -> Person -> Person
7373
setPersonPostcode pc p = p { address { postCode = pc } }
7474
```
7575

76+
A record update function can also be defined by using an `_` inplace of the record to be updated like:
77+
78+
```purescript
79+
_ { fieldName = newValue }
80+
```
81+
7682
## Field Names
7783

7884
Symbols which are illegal value identifiers, such as title-cased identifiers or ones containing spaces, can be used to identify a field by enclosing it in double-quotes:

0 commit comments

Comments
 (0)