4 ms·
It's strange that on the Kotlin side the author goes out of their way to show 'shorter' ways to do things that are also available in Swift but not illustrated.
by Black-Plaid 9y ago
It's strange that on the Kotlin side the author goes out of their way to show 'shorter' ways to do things that are also available in Swift but not illustrated.
let sorted = [1, 3, 6].sorted()
let sum = [1, 3. 6].reduce(0, +)
as examples
- agumonkey 9y agowhile we're at it http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.1618 http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.16...
- throwaway7645 9y agoWhy are you citing an FP comp Sci professor? I must've missed something
- agumonkey 9y agoseeing reduce in swift made me think about the universality of fold, which is the paper linked.
- throwaway7645 9y agoAh, was about to say that all goes back to lambda calculus by Church and could be found in Lisp probably around ~1958.
- agumonkey 9y agoActually I think there's a relation with exponentials and integral calculus. Or anything hyper-iteration related.
- timjver 9y agoThere's a PR that fixes one of them which was filed on December 22 of last year... Yikes.