https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
announcements
  • a

    allan.conda

    06/18/2020, 4:48 AM
    Does it still make sense to use
    enum
    in Kotlin 1️⃣, or do you just use
    sealed class
    for everything 2️⃣? Is there a disadvantage from using sealed classes?
    1️⃣ 10
    i
    m
    +3
    9 replies · 6 participants
  • m

    Mr.NiceGuy

    06/18/2020, 8:51 AM
    Any idea how to set duplicate strategy to exclude in gradle 6.5 on buildscript?
    d
    1 reply · 2 participants
  • s

    Stefan Beyer

    06/18/2020, 9:51 AM
    Does anyone have an idea why this happens?
    inline fun <reified T> ObjectMapper.read(json: String) = readValue<T>(json)
    inline fun <reified T> ObjectMapper.readList(json: String) = read<List<T>>(json)
    
    val mapper = ObjectMapper().registerKotlinModule() // fasterxml.jackson
    data class Person(val name: String, val role: String)
    val json = """[{"name":"Alice","role":"transmitter"},{"name":"Bob","role":"receiver"}]"""
    
    val value1 = mapper.read<List<Person>>(json)
    val value2 = mapper.readList<Person>(json)
    println(value1) // value1 is a List<Person>
    println(value2) // value2 is a List<Map<String, Any>>
    When composing a reified type through multiple inline functions, the generic part seems to get gobbled up by the erasure, like it wasn't reified...
    s
    2 replies · 2 participants
  • p

    Philipp Mayer

    06/18/2020, 10:24 AM
    Is there a more idiomatic way to do the following operation? Thank you!
    it.receiver
    can either be of type ABC or DEF. If its ABC, collect to the first list, if its DEF, collect to the second list
    val payments = findOpenPayments.get()
                    .groupBy { it.receiver == "ABC" }
    
            val somePayments = payments.filter { it.key }.flatMap { it.value }
            val otherPayments = payments.filter { !it.key }.flatMap { it.value }
    s
    s
    5 replies · 3 participants
  • p

    Pacane

    06/18/2020, 1:39 PM
    Is there a way to filter a list with a predicate, but return 2 lists, one containing the matches, and another containing the non-matching elements?
    a
    2 replies · 2 participants
  • j

    Jakub

    06/18/2020, 1:47 PM
    Is there an elegant way to add something to map only if it’s not null? code below won’t compile
    mapOf(
      LIST_ID to listId,
      eventId?.let { EVENT_ID to eventId }
    )
    o
    m
    3 replies · 3 participants
  • d

    dave08

    06/18/2020, 3:49 PM
    Is there a way to do this:
    val fixture = listOf(
        mapOf(
            "a" to listOf(1,2,3),
            "b" to listOf(4)
        ),
        mapOf(
            "a" to listOf(5,6,7),
            "c" to listOf(8)
        )
    )
    
    // Should become
    val result = mapOf(
      "a" to listOf(1,2,3,5,6,7),
      "b" to listOf(4),
      "c" to listOf(8)
    )
    d
    m
    3 replies · 3 participants
  • t

    turansky

    06/18/2020, 8:48 PM
    Is there way to mark method/property as ignored by IDEA autocomplete?
    // must be invisible in autocomplete
    fun first() {}
    
    fun second() {}
    s
    a
    6 replies · 3 participants
  • p

    Pierre Marais

    06/19/2020, 10:40 AM
    Is there a function in Kotlin similar to scala's
    .group
    on a collection? i.e.
    val list = List(1,2,3,4,5,6,7,8,9,10)
    val grouped = list.group(2)
    // List(List(1,2), List(3,4), List(5,6), List(7,8) , List(9,10))
    a
    3 replies · 2 participants
  • s

    Slackbot

    06/19/2020, 11:03 AM
    This message was deleted.
    h
    l
    3 replies · 3 participants
  • p

    Paul Stott

    06/19/2020, 12:11 PM
    Silly question, but does anyone know how you set a property of java.lang.Class in yaml, specifically the micronaut.executors.*.thread-factory-class property? I've tried variations of the theme
    my.FixedThreadFactory::class.java
    a
    2 replies · 2 participants
  • k

    Kelvin Law

    06/19/2020, 12:52 PM
    Hi, in Java, it is considered bad practice for try catching
    Throwable
    instead of `Exception`Does anyone know why
    runCatching
    for
    kotlin.Result
    is catching
    Throwable
    instead of
    Exception
    ? https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/run-catching.html
    e
    3 replies · 2 participants
  • v

    Va3000

    06/19/2020, 1:55 PM
    hello friends i am new here. I am searching channel ODS but i can not find it. is here some channel for people who interested in Ods.ai
    m
    6 replies · 2 participants
  • r

    Rita Curado

    06/19/2020, 1:58 PM
    Hi! I am trying to add a processor annotation inside a
    build.gradle.kts
    file but it keeps saying that I have mismatch types:
    Type mismatch: inferred type is String but Action<KaptExtension> was expected
    plugins {
        id( "com.android.library")
        id("dev.icerock.mobile.multiplatform-resources")
        kotlin("multiplatform")
        kotlin("kapt")
    }
    
    kotlin {
      sourceSets {
         val androidMain by getting {
                dependencies {
                    implementation("com.github.bumptech.glide:glide:4.11.0")
                    kapt("com.github.bumptech.glide:compiler:4.11.0")
                }
            }
      }
    }
    Does anybody know how to use
    kapt
    ?
    m
    2 replies · 2 participants
  • r

    Robert Jaros

    06/19/2020, 4:04 PM
    how to translate this from groovy to kotlin gradle dsl?
    dependencies {
        compile fileTree(dir: 'lib', include: ['*.jar'])
    }
    j
    a
    2 replies · 3 participants
  • g

    Guy Bieber

    06/19/2020, 7:59 PM
    java.security.cert.CertificateException: com.android.org.conscrypt.OpenSSLX509CertificateFactory$ParsingException: com.android.org.conscrypt.OpenSSLX509CertificateFactory$ParsingException: java.lang.RuntimeException: error:0c0000be:ASN.1 encoding routines:OPENSSL_internal:WRONG_TAG
    	at com.android.org.conscrypt.OpenSSLX509CertificateFactory.engineGenerateCertificate(OpenSSLX509CertificateFactory.java:284)
    	at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:366)
    	at com.nikolamotor.crypto.crypto.PublicKeyToX509Cert(Crypto.kt:316)
    	at com.nikolamotor.crypto.crypto.storeKeyPair(Crypto.kt:374)
    	at com.nikolamotor.crypto.crypto.generateKeyPair(Crypto.kt:433)
    	at com.nikolamotor.crypto.crypto.generateTestKeyPair(Crypto.kt:287)
    	at com.nikolamotor.crypto.CryptoTest.<init>(CryptoTest.kt:47)
    	at java.lang.reflect.Constructor.newInstance0(Native Method)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
    	at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:217)
    	at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:266)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    	at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:263)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:104)
    	at org.junit.runners.Suite.runChild(Suite.java:128)
    	at org.junit.runners.Suite.runChild(Suite.java:27)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    	at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
    	at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:392)
    	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2196)
    Caused by: com.android.org.conscrypt.OpenSSLX509CertificateFactory$ParsingException: com.android.org.conscrypt.OpenSSLX509CertificateFactory$ParsingException: java.lang.RuntimeException: error:0c0000be:ASN.1 encoding routines:OPENSSL_internal:WRONG_TAG
    	at com.android.org.conscrypt.OpenSSLX509CertificateFactory$Parser.generateItem(OpenSSLX509CertificateFactory.java:122)
    	at com.android.org.conscrypt.OpenSSLX509CertificateFactory.engineGenerateCertificate(OpenSSLX509CertificateFactory.java:282)
    	... 34 more
    Caused by: com.android.org.conscrypt.OpenSSLX509CertificateFactory$ParsingException: java.lang.RuntimeException: error:0c0000be:ASN.1 encoding routines:OPENSSL_internal:WRONG_TAG
    	at com.android.org.conscrypt.OpenSSLX509Certificate.fromX509PemInputStream(OpenSSLX509Certificate.java:161)
    	at com.android.org.conscrypt.OpenSSLX509CertificateFactory$1.fromX509PemInputStream(OpenSSLX509CertificateFactory.java:227)
    	at com.android.org.conscrypt.OpenSSLX509CertificateFactory$1.fromX509PemInputStream(OpenSSLX509CertificateFactory.java:223)
    	at com.android.org.conscrypt.OpenSSLX509CertificateFactory$Parser.generateItem(OpenSSLX509CertificateFactory.java:101)
    	... 35 more
    Caused by: java.lang.RuntimeException: error:0c0000be:ASN.1 encoding routines:OPENSSL_internal:WRONG_TAG
    	at com.android.org.conscrypt.NativeCrypto.PEM_read_bio_X509(Native Method)
    	at com.android.org.conscrypt.OpenSSLX509Certificate.fromX509PemInputStream(OpenSSLX509Certificate.java:155)
    	... 38 more
    e
    1 reply · 2 participants
  • g

    Guy Bieber

    06/19/2020, 7:59 PM
    I have an EC keypair generated with the AndroidOpenSSL provider. I am having an issue trying to store (and eventually retrieve) the key to the Android Keystore. Here is what I try.
    val certArray : Array<Certificate> = arrayOf(PublicKeyToX509Cert(keyPair.public))
    keyStore.setKeyEntry(alias, keyPair.private.encoded,  certArray)
    
    private fun PublicKeyToX509Cert(pubKey: PublicKey): Certificate{
            var pem = ecPublicKeyToCert(pubKey as ECPublicKey)
            Log.v(TAG,"PEM:\n${pem}")
            val targetStream: InputStream = pem.byteInputStream()
            return CertificateFactory.getInstance("X.509").generateCertificate(targetStream)
    }
    I get the following error trying to store the key:
    a
    d
    6 replies · 3 participants
  • g

    groostav

    06/19/2020, 9:17 PM
    hey guys, my software takes math expressions from users and evaluates them (eg
    x1 + x2 - max(thirdVar, fourthVar) * cos(y6)
    ). Thus I got to write a little compiler and I did it on top of antlr. I recently converted it to generate a little stack assembly language (implemented with a sealed class, eg (
    sealed class ASM()
    ,
    data class PushI(val int: Int): ASM()
    ,
    object Multiply: ASM()
    ,
    data class InvokeBinary(val name: String)
    ), expecting that to be fast as hell. its not. Its actually slower than when I just did a tree evaluation. I'm going to stripe the sealed classes such that they use enums, in hopes that makes things run faster. I want to be able to evaluate these expressions at the rate of ~100,000 per sec. Any idea how i might get there? this is https://github.com/EmpowerOperations/babel\
    n
    3 replies · 2 participants
  • s

    Simon Lin

    06/20/2020, 8:31 AM
    Can we only allow the latest consumer receive data when use
    flow
    ? For example,
    val flow = flow { 
        var i = 0
        while(true) { 
            delay(1000) 
            println("Emit $i")
            emit(i++)
        }
    }
    launch { flow.collect { println("A: got $it") } }
    launch { flow.collect { println("B: got $it") } }
    I want only B can get data and if B stop collect than A can get data.
    a
    5 replies · 2 participants
  • n

    Nikky

    06/20/2020, 10:19 AM
    since in #kotlinx-html are just a dozen of people, i hope here anybody knows this stuff
    a
    3 replies · 2 participants
  • t

    Toddobryan

    06/21/2020, 6:58 PM
    And to confuse things even more, when I add the same version of the project itself to my Gradle build instead of depending on the jar, everything builds fine.
    j
    3 replies · 2 participants
  • s

    Slackbot

    06/22/2020, 2:44 AM
    This message was deleted.
    n
    1 reply · 2 participants
  • l

    LoganDark

    06/22/2020, 7:17 AM
    Does anyone know what's going on here?
    h
    a
    +1
    83 replies · 4 participants
  • a

    Animesh Sahu

    06/22/2020, 11:54 AM
    Somebody uses Kotlin Scripts? It seems a simple hello world program takes 3800ms compared to python taking around 60ms. Is it supposed to be that slow or?
    l
    1 reply · 2 participants
  • l

    LoganDark

    06/22/2020, 12:03 PM
    I don't think Kotlin is interpreted, doesn't it need to be compiled to a Java program before running? And then that incurs JVM startup costs and all that...
    a
    t
    6 replies · 3 participants
  • k

    kenkyee

    06/22/2020, 12:22 PM
    First run is slow because it gets compiled...
    a
    l
    4 replies · 3 participants
  • s

    Slackbot

    06/22/2020, 1:38 PM
    This message was deleted.
    z
    1 reply · 2 participants
  • d

    darkmoon_uk

    06/23/2020, 3:41 AM
    Itching to know when 1.4 is going to be released - @Dominaezzz what's the latest from your crystal ball?
    👆 1
    s
    b
    +3
    5 replies · 6 participants
  • a

    Animesh Sahu

    06/23/2020, 10:33 AM
    Did sb read it? https://kotlinlang.slack.com/archives/C0922A726/p1592805872467900
    j
    1 reply · 2 participants
  • x

    Xuc Xiem

    06/23/2020, 11:21 AM
    Hi All, I have a
    Iterable<A>
    and want to create a
    Map<A, Int>
    with a function
    f: A -> Int?
    . The values in the map cannot be null. So I write something like this:
    iterable
      .map { Pair(it, f(it)) }      // Iterable<Pair<A, Int?>>
      .filter { it.second != null } // still Iterable<Pair<A, Int?>> but we can be sure the Int is not null
      .map { Pair(it.first, it.second!!) } // now it is Iterable<Pair<A, Int>>
      .toMap()
    Is there any better way?
    c
    j
    +1
    9 replies · 4 participants
Powered by Linen
Title
x

Xuc Xiem

06/23/2020, 11:21 AM
Hi All, I have a
Iterable<A>
and want to create a
Map<A, Int>
with a function
f: A -> Int?
. The values in the map cannot be null. So I write something like this:
iterable
  .map { Pair(it, f(it)) }      // Iterable<Pair<A, Int?>>
  .filter { it.second != null } // still Iterable<Pair<A, Int?>> but we can be sure the Int is not null
  .map { Pair(it.first, it.second!!) } // now it is Iterable<Pair<A, Int>>
  .toMap()
Is there any better way?
c

Chantry Cargill

06/23/2020, 11:23 AM
iterable.mapNotNull { thing ->
  f(thing)?.let { thing to it }
}
❤️ 1
➕ 4
👍 3
j

James Fagan

06/23/2020, 11:26 AM
iterable
  .associateWith { f(it) }
  .filterValues { it != null }
d

diesieben07

06/23/2020, 11:26 AM
James that still produces a
Map<A, Int?>
instead of
Map<A, Int>
j

James Fagan

06/23/2020, 11:29 AM
True, in this case I think its fine to then cast it to
Map<A, Int>
Or something like:
iterable
  .associateWith { f(it) }
  .filterValues { it != null }
  .mapValues { it ?: 0 }
d

diesieben07

06/23/2020, 11:29 AM
Unchecked casts should be avoided if you can...
j

James Fagan

06/23/2020, 11:31 AM
IMO the cast is fine when it's guaranteed to be safe 🤷‍♂️
x

Xuc Xiem

06/23/2020, 11:54 AM
The cast is fine, however IntelliJ will give a warning, right? Then I don't know which warnings are good, which are bad. The
iterable.mapNotNull { thing -> f(thing)?.let { thing to it } }
is excellent. I always wonder what's the equivalent of Scala's
.collect
in Kotlin.
mapNotNull ?.let
might not be that powerful but good enough.
d

diesieben07

06/23/2020, 11:55 AM
I think
mapNotNull
is the closest equivalent
View count: 1