class ListOps {
static append(list1, list2) {
list1+list2
}
static concatenate(lists) {
lists.collectMany{ it }
}
static filter(list, fn) {
list.findAll fn
}
static length(list) {
list.size()
}
static map(list, fn) {
list.collect fn
}
static foldl(list, fn, initial) {
list.inject(initial, {acc, elm-> fn(acc,elm)})
}
static foldr(list, fn, initial) {
list.reverse().inject(initial, {acc, elm-> fn(acc,elm)})
}
static reverse(list) {
list.reverse()
}
}
Thank you, friend!
![image.png](https://steemitimages.com/640x0/https://cdn.steemitimages.com/DQmd7of2TpLGqvckkrReWahnkxMWH6eMg5upXesfsujDCnW/image.png)
![image.png](https://steemitimages.com/640x0/https://cdn.steemitimages.com/DQmWDnFh7Kcgj2gdPc5RgG9Cezc4Bapq8sQQJvrkxR8rx5z/image.png)
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
please click it!
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)
The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit