3 ms·
(disclaimer: I think Kotlin is cool) And non-lazy map/reduce/filter. Which I almost see as a deal-breaker.
by edgyswingset 11y ago
(disclaimer: I think Kotlin is cool)
And non-lazy map/reduce/filter. Which I almost see as a deal-breaker.
- icholy 11y agoIt's not that hard to implement your own stream abstraction.
- deleted 11y ago[deleted]
- yole 11y agoKotlin does have lazy map/reduce/filter: those are available through the Sequence interface.
- edgyswingset 11y agoIt's very limited. Many of the functions you use when operating with collections also return lists, not sequences.
- mike_hearn 11y agoSequence has much the same extensions available on it as other collections. I did a tutorial a week or so ago (it's not online yet, unfortunately) on FP in Kotlin. We wrote a little app to do IntelliSense style autocompletion on an n-gram model. The core code was purely functional and used lazyness as well. I suspect "does Kotlin support FP" is one of those questions that's doomed to turn into a no-true-scotsman thing: whatever support is available will be considered insufficient by true FP fans :-) But it's good enough to let you write code in a typical functional style in many cases, with little cost.