blob: de14a33ab3f8fa21b357fa7525ebae52364a4503 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
Explanation: You can only access fields on records, like this:
┌─────────────────────────────────┐
│ { foo = True, bar = "ABC" }.foo │ This is valid ...
└─────────────────────────────────┘
┌───────────────────────────────────────────┐
│ λ(r : { foo : Bool, bar : Text }) → r.foo │ ... and so is this
└───────────────────────────────────────────┘
... but you can only access fields if they are present
For example, the following expression is $_NOT valid:
┌─────────────────────────────────┐
│ { foo = True, bar = "ABC" }.qux │
└─────────────────────────────────┘
⇧
Invalid: the record has no ❰qux❱ field
You tried to access a field named:
↳ $txt0
... but the field is missing because the record only defines the following fields:
↳ $txt1
|