LambdaAsCallable.yql 729 B

12345678910111213141516171819202122232425
  1. (
  2. #comment
  3. (let config (DataSource 'config))
  4. (let world (Configure! world config 'PureDataSource 'yt))
  5. (let res_sink (DataSink 'result))
  6. (let list (AsList (String 'A) (String 'B) (String 'C) (String 'D) (String 'E)))
  7. (let state (String '""))
  8. (let fold (Udf 'TypeInspection.Fold (Void)
  9. (TupleType
  10. (TupleType
  11. (TypeOf list)
  12. (TypeOf state)
  13. (CallableType '() '((DataType 'String)) '((DataType 'String)) '((DataType 'String)))
  14. )
  15. (StructType)
  16. (TupleType)
  17. )
  18. ))
  19. (let func (lambda '(item state) (Concat state item)))
  20. (let data (Apply fold list state func))
  21. (let world (Write! world res_sink (Key) data '()))
  22. (let world (Commit! world res_sink))
  23. (return world)
  24. )