Source/Packages

Observe.Value

packages/observability/src/Observe/Value.alpha

564 lines114 declarations29.3 KiBSHA-256 09f8c02938ee

def · lines 450–468

aosDecodeTagged

Full file
One tagged value, its nested values decoded by `decode` (AOS-JSON-005): the tag chooses the decoder; an unknown tag is rejected.
450def aosDecodeTagged =
451  (lambda unrestricted decode : (pi unrestricted value : (family JSON) . (family AosDecoded)) .
452    (lambda unrestricted value : (family JSON) .
453      (let unrestricted tag = (aosMemberBytes b"t" value)
454        in (aosChoose (family AosDecoded) (naturalIsZero (aosMemberIsString b"t" value)) aosRejected
455             (aosChoose (family AosDecoded) (bytes-equal tag b"bool") (aosDecodeBool value)
456             (aosChoose (family AosDecoded) (bytes-equal tag b"u64") (aosDecodeU64 value)
457             (aosChoose (family AosDecoded) (bytes-equal tag b"i64") (aosDecodeI64 value)
458             (aosChoose (family AosDecoded) (bytes-equal tag b"bigint") (aosDecodeBigInt value)
459             (aosChoose (family AosDecoded) (bytes-equal tag b"decimal") (aosDecodeDecimal value)
460             (aosChoose (family AosDecoded) (bytes-equal tag b"f32") (aosDecodeFloat 8 value)
461             (aosChoose (family AosDecoded) (bytes-equal tag b"f64") (aosDecodeFloat 16 value)
462             (aosChoose (family AosDecoded) (bytes-equal tag b"text") (aosDecodeText value)
463             (aosChoose (family AosDecoded) (bytes-equal tag b"bytes") (aosDecodeBytes value)
464             (aosChoose (family AosDecoded) (bytes-equal tag b"ref") (aosDecodeRef value)
465             (aosChoose (family AosDecoded) (bytes-equal tag b"null") (aosDecodeNull value)
466             (aosChoose (family AosDecoded) (bytes-equal tag b"list") (aosDecodeList decode value)
467             (aosChoose (family AosDecoded) (bytes-equal tag b"map") (aosDecodeMap decode value)
468               aosRejected)))))))))))))))))

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.