SafeCastOverOptional.yql 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. (
  2. (let config (DataSource 'config))
  3. (let world (Configure! world config 'PureDataSource 'yt))
  4. (let res_sink (DataSink 'result))
  5. # Int32? -> Uint16
  6. (let targetType (OptionalType (DataType 'Uint16)))
  7. (let cast (SafeCast (Just (Int32 '1)) targetType))
  8. (let world (Write! world res_sink (Key) cast '('('type))))
  9. (let cast (SafeCast (Just (Int32 '1000000)) targetType))
  10. (let world (Write! world res_sink (Key) cast '('('type))))
  11. (let cast (SafeCast (Nothing (OptionalType (DataType 'Int32))) targetType))
  12. (let world (Write! world res_sink (Key) cast '('('type))))
  13. # Int32? -> Uint16?
  14. (let targetType (OptionalType (DataType 'Uint16)))
  15. (let cast (SafeCast (Just (Int32 '1)) targetType))
  16. (let world (Write! world res_sink (Key) cast '('('type))))
  17. (let cast (SafeCast (Just (Int32 '1000000)) targetType))
  18. (let world (Write! world res_sink (Key) cast '('('type))))
  19. (let cast (SafeCast (Nothing (OptionalType (DataType 'Int32))) targetType))
  20. (let world (Write! world res_sink (Key) cast '('('type))))
  21. # Int32? -> Uint16???
  22. (let targetType (OptionalType (OptionalType (OptionalType (DataType 'Uint16)))))
  23. (let cast (SafeCast (Just (Int32 '1)) targetType))
  24. (let world (Write! world res_sink (Key) cast '('('type))))
  25. (let cast (SafeCast (Just (Int32 '1000000)) targetType))
  26. (let world (Write! world res_sink (Key) cast '('('type))))
  27. (let cast (SafeCast (Nothing (OptionalType (DataType 'Int32))) targetType))
  28. (let world (Write! world res_sink (Key) cast '('('type))))
  29. # Int32??? -> Uint16?
  30. (let targetType (OptionalType (DataType 'Uint16)))
  31. (let cast (SafeCast (Just (Just (Just (Int32 '1)))) targetType))
  32. (let world (Write! world res_sink (Key) cast '('('type))))
  33. (let cast (SafeCast (Just (Just (Just (Int32 '1000000)))) targetType))
  34. (let world (Write! world res_sink (Key) cast '('('type))))
  35. (let cast (SafeCast (Nothing (OptionalType (OptionalType (OptionalType (DataType 'Int32))))) targetType))
  36. (let world (Write! world res_sink (Key) cast '('('type))))
  37. (let cast (SafeCast (Just (Nothing (OptionalType (OptionalType (DataType 'Int32))))) targetType))
  38. (let world (Write! world res_sink (Key) cast '('('type))))
  39. (let cast (SafeCast (Just (Just (Nothing (OptionalType (DataType 'Int32))))) targetType))
  40. (let world (Write! world res_sink (Key) cast '('('type))))
  41. # Int32??? -> Uint16??
  42. (let targetType (OptionalType (OptionalType (DataType 'Uint16))))
  43. (let cast (SafeCast (Just (Just (Just (Int32 '1)))) targetType))
  44. (let world (Write! world res_sink (Key) cast '('('type))))
  45. (let cast (SafeCast (Just (Just (Just (Int32 '1000000)))) targetType))
  46. (let world (Write! world res_sink (Key) cast '('('type))))
  47. (let cast (SafeCast (Nothing (OptionalType (OptionalType (OptionalType (DataType 'Int32))))) targetType))
  48. (let world (Write! world res_sink (Key) cast '('('type))))
  49. (let cast (SafeCast (Just (Nothing (OptionalType (OptionalType (DataType 'Int32))))) targetType))
  50. (let world (Write! world res_sink (Key) cast '('('type))))
  51. (let cast (SafeCast (Just (Just (Nothing (OptionalType (DataType 'Int32))))) targetType))
  52. (let world (Write! world res_sink (Key) cast '('('type))))
  53. # Int32??? -> Uint16????
  54. (let targetType (OptionalType (OptionalType (OptionalType (OptionalType (DataType 'Uint16))))))
  55. (let cast (SafeCast (Just (Just (Just (Int32 '1)))) targetType))
  56. (let world (Write! world res_sink (Key) cast '('('type))))
  57. (let cast (SafeCast (Just (Just (Just (Int32 '1000000)))) targetType))
  58. (let world (Write! world res_sink (Key) cast '('('type))))
  59. (let cast (SafeCast (Nothing (OptionalType (OptionalType (OptionalType (DataType 'Int32))))) targetType))
  60. (let world (Write! world res_sink (Key) cast '('('type))))
  61. (let cast (SafeCast (Just (Nothing (OptionalType (OptionalType (DataType 'Int32))))) targetType))
  62. (let world (Write! world res_sink (Key) cast '('('type))))
  63. (let cast (SafeCast (Just (Just (Nothing (OptionalType (DataType 'Int32))))) targetType))
  64. (let world (Write! world res_sink (Key) cast '('('type))))
  65. (let world (Commit! world res_sink))
  66. (return world)
  67. )