I have just started looking at Kotlin, I have been...
# announcements
s
I have just started looking at Kotlin, I have been using F# on .NET for a while now and I am liking Kotlin. I am missing pipe operator in Kotlin though, is there any plan to bring the pipe operator to Kotlin?
m
Why do you need the pipe operator? It may be idiomatic F#, but it's not idiomatic Kotlin. Doesn't extension functions and method-call-chaining kind of solve the same problem?
Like, instead of this in a language with the pipe-operator:
Copy code
list |> map f1 |> flatMap f2
You would just do
list.map(f1).flatMap(f2)
.
g
There are no plans as I know, and there is no proposal for this
Maybe you could show some example of typical usage which you missed in Kotlin, I'm really curious how different it is comparing to F#
e
Kotlin has two features that mike piping much less needed: 1. Kotlin has extensions, which usually let you "pipe" things directly in a natural 
.call
 style, e.g. 
collection.filter {...}.map{...}
 (no need for a pipe here) 2. Kotlin has 
.let
 scope function that covers the case for non-extension functions, e.g. 
collection.first().let { println(it) }
👍 3