TryRemoveAllOptionals2.yqls 853 B

1234567891011121314151617181920212223
  1. (
  2. (let config (DataSource 'config))
  3. (let res_sink (DataSink 'result))
  4. ### Tuple
  5. # (Int8?, String, (Int32, Int64)?, Just(Nothing(String?)) (success)
  6. (let value '((Just (Int8 '1)) (String 'str) (Just '((Int32 '2) (Int64 '3))) (Just (Nothing (OptionalType (DataType 'String))))))
  7. (let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
  8. (let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
  9. ### Struct
  10. # Struct<Int8?, String, (Int32, Int64)?> (success)
  11. (let value (AsStruct '('a (Just (Int8 '1))) '('b (String 'str)) '('c (Just '((Int32 '2) (Int64 '3)))) '('d (Just (Nothing (OptionalType (DataType 'String)))))))
  12. (let tryRemoveAllOptionalsResult (TryRemoveAllOptionals value))
  13. (let world (Write! world res_sink (Key) tryRemoveAllOptionalsResult '('('type))))
  14. (let world (Commit! world res_sink))
  15. (return world)
  16. )