Join Slack
Powered by
It's a prepend list which is more idiomatic for fu...
# getting-started
s
siladu
01/20/2018, 2:07 PM
It's a prepend list which is more idiomatic for functional programming, e.g. separating head and tail in recursive functions:
https://alvinalexander.com/scala/how-to-use-lists-nil-cons-scala-match-case-expressions
siladu
01/20/2018, 2:08 PM
has nice pattern match support too
k
kristofdho
01/20/2018, 2:08 PM
I am aware what it is, and it's really easy to implement yourself
kristofdho
01/20/2018, 2:09 PM
I'm looking if maybe one of the functional libraries has one
kristofdho
01/20/2018, 2:10 PM
https://github.com/arrow-kt/arrow/blob/master/arrow-data/src/main/kotlin/arrow/data/NonEmptyList.kt
👍 1
kristofdho
01/20/2018, 2:11 PM
no `Cons`/`Nil` matching tho, i think
s
siladu
01/20/2018, 2:11 PM
yeh, I noticed there were several instances of cons list implementations in the Kotlin source itself,
https://github.com/JetBrains/kotlin/search?l=Kotlin&q=cons&type=&utf8=%E2%9C%93
Would be nice if there was native support
siladu
01/20/2018, 2:20 PM
https://github.com/MarioAriasC/funKTionale/wiki/Collection-utils
Open in Slack
Previous
Next