an availability slot (AOS-JSON-006): {state: present, value} with the
present value's own rule, or a non-present state, an optional structured
reason, and no value
269def aosSlotCode =
270 (lambda unrestricted slot : (family JSON) .
271 (lambda unrestricted present : (pi unrestricted value : (family JSON) . Nat) .
272 (let unrestricted state =
273 (aosMemberBytes b"state" slot)
274 in
275 (naturalSelect
276 (naturalIsZero (aosMemberIsString b"state" slot))
277 11
278 (naturalSelect
279 (bytes-equal state b"present")
280 (naturalSelect
281 (aosHasExactly2 b"state" b"value" slot)
282 (present (aosMemberValue b"value" slot))
283 11)
284 (naturalSelect
285 (aosIsAbsenceState state)
286 (naturalSelect
287 (aosHasExactly1 b"state" slot)
288 0
289 (naturalSelect
290 (aosHasExactly2 b"state" b"reason" slot)
291 (naturalSelect (aosIsObject (aosMemberValue b"reason" slot)) 0 11)
292 11))
293 11))))))The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.