Merge.yqls 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. (
  2. #comment
  3. (let config (DataSource 'config))
  4. (let res_sink (DataSink 'result))
  5. (let list1 (AsList
  6. (AsStruct '('a (Uint32 '4)) '('b (String 'c)))
  7. (AsStruct '('a (Uint32 '1)) '('b (String 'd)))
  8. (AsStruct '('a (Uint32 '3)) '('b (String 'b)))
  9. ))
  10. (let list2 (AsList
  11. (AsStruct '('a (Uint32 '2)) '('b (String 'a)))
  12. (AsStruct '('a (Uint32 '5)) '('b (String 'y)))
  13. (AsStruct '('a (Uint32 '1)) '('b (String 'z)))
  14. ))
  15. (let world (Write! world res_sink (Key)
  16. (Merge
  17. list1
  18. list2
  19. )
  20. '('('type))))
  21. (let world (Write! world res_sink (Key)
  22. (Merge
  23. (Sort list1 (Bool 'True) (lambda '(item) (Member item 'a)))
  24. (Sort list2 (Bool 'True) (lambda '(item) (Member item 'a)))
  25. )
  26. '('('type))))
  27. (let world (Write! world res_sink (Key)
  28. (Merge
  29. (Sort list1 (Bool 'False) (lambda '(item) (Member item 'a)))
  30. (Sort list2 (Bool 'False) (lambda '(item) (Member item 'a)))
  31. )
  32. '('('type))))
  33. (let world (Write! world res_sink (Key)
  34. (Merge
  35. (Sort list1 '((Bool 'True) (Bool 'True)) (lambda '(item) '((Member item 'a) (Member item 'b))))
  36. (Sort list2 '((Bool 'True) (Bool 'True)) (lambda '(item) '((Member item 'a) (Member item 'b))))
  37. )
  38. '('('type))))
  39. (let world (Commit! world res_sink))
  40. (return world)
  41. )