AlterToOverList.yqls 914 B

12345678910111213141516171819202122232425262728
  1. (
  2. (library "alterto.yql")
  3. (import alterto_module '"alterto.yql")
  4. (let config (DataSource 'config))
  5. # List<Int32> -> List<Uint16> (success)
  6. (let targetType (ListType (DataType 'Uint16)))
  7. (let emptyTarget (List targetType))
  8. (let src (AsList (Int32 '1) (Int32 '2) (Int32 '3)))
  9. (let world (Apply (bind alterto_module 'doAlterTo) world src targetType emptyTarget))
  10. # List<Int32> -> List<Uint16> (fail)
  11. (let targetType (ListType (DataType 'Uint16)))
  12. (let emptyTarget (List targetType))
  13. (let src (AsList (Int32 '1) (Int32 '"-2") (Int32 '3)))
  14. (let world (Apply (bind alterto_module 'doAlterTo) world src targetType emptyTarget))
  15. # List<Int32?> -> List<Uint16> (fail)
  16. (let targetType (ListType (DataType 'Uint16)))
  17. (let emptyTarget (List targetType))
  18. (let src (AsList (Just (Int32 '1)) (Null) (Just (Int32 '3))))
  19. (let world (Apply (bind alterto_module 'doAlterTo) world src targetType emptyTarget))
  20. (return world)
  21. )