StaticMap.yqls 555 B

1234567891011121314151617
  1. (
  2. #comment
  3. (let config (DataSource 'config))
  4. (let res_sink (DataSink 'result))
  5. (let default (lambda '(x) (block '(
  6. (return (Coalesce x (Default (OptionalItemType (TypeOf x)))))
  7. ))))
  8. (let tuple '((Just (Uint32 '1)) (Just (String 'X))))
  9. (let struct (AsStruct '('a (Nothing (OptionalType (DataType 'Uint32)))) '('b (Just (String 'Y)))))
  10. (let world (Write! world res_sink (Key) (StaticMap tuple default) '('('type))))
  11. (let world (Write! world res_sink (Key) (StaticMap struct default) '('('type))))
  12. (let world (Commit! world res_sink))
  13. (return world)
  14. )