https://kotlinlang.org logo
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
arrow
  • s

    stojan

    08/19/2021, 6:28 AM
    https://discuss.kotlinlang.org/t/why-does-is-this-code-executed-faster-in-a-thread-pool-with-1-thread-compared-to-one-with-more/22666/2
    s
    • 2
    • 1
  • s

    Sergei Zubov

    08/19/2021, 6:01 PM
    Hello! Is there any trick to make
    parTraverseEither
    return
    NonEmptyList
    when called on
    NonEmptyList
    receiver?
    s
    • 2
    • 2
  • r

    rcd27

    08/20/2021, 12:38 PM
    There is a survey by
    JetBrains
    , check this out: they have
    Arrow
    option in it! YEAH! (https://surveys.jetbrains.com/s3/kt-ktor-annual-customer-survey-2021)
    🥳 5
    s
    s
    • 3
    • 8
  • s

    Stefan

    08/20/2021, 2:13 PM
    Hi, how are
    generator-scripts/tuple.generator.kts
    run in the arrow build? I'd like to add mapN to nullable tuples
    s
    • 2
    • 9
  • g

    Gavin Ray

    08/22/2021, 8:07 PM
    Hey all, I see a branch on
    arrow-meta
    called
    as-var-invariants
    It seems to add some commits around
    pre
    ,
    post
    and
    invariant
    functions. Is this going to enable a DSL for a sort of Design-by-Contract style programming similar to Ada and D, where you can state pre/post-conditions of a method and invariants of a method or class? If so, very exciting! • https://github.com/arrow-kt/arrow-meta/commit/38f6850bbeab3e2df7fffbd1409d0415c57a0006#diff-0cba0892a09ca12cf39e0816[…]8d75d7633e5d6fce55dd30fbfc15e • https://github.com/arrow-kt/arrow-meta/commit/64efe5e7fed1c98dfd9460c79ec02f0eb6477708#diff-d8893c41325132d95cc89c5a[…]6dd9ea55a0c7fc4413d35bfb1d0eb
    r
    m
    • 3
    • 8
  • f

    Francesco Cervone

    08/25/2021, 3:26 PM
    Hi everyone! I have a very long form and I’m using
    ValidatedNel<E, A>.zip
    for validation. Unfortunately,
    zip
    accepts at most 9 arguments. Do you have any suggestions about using
    Validated
    with more than 9 arguments in an “nice” way?
    validatedArg0.zip(
      validatedArg1,
      validatedArg2,
      validatedArg3,
      validatedArg4,
      validatedArg5,
      validatedArg6,
      validatedArg7,
      validatedArg8,
      validatedArg9,
      ::someFunction
    )
    s
    • 2
    • 3
  • g

    Gavin Ray

    08/28/2021, 4:48 PM
    Brief, possibly dumb question: I'm fairly new to Kotlin -- but not to programming, or to the fundamentals of FP (ADT's, higher-order functions, whatnot. No clue about monoids, endofunctors and the likes though, bit over my head) Am curious about the comparison between Arrow's
    Option<T>
    and Kotlin's
    Result<T>
    (which I know Kotlin devs have said not to use directly, though not entirely sure why) And similarly for things like
    .runCatching { }
    Has anyone transitioned from using the basic FP primitives available in Kotlin stdlib to using mostly/exclusively Arrow, and could share thoughts/opinions and experiences? Would be grateful 🙏 Thank you!
    r
    s
    m
    • 4
    • 5
  • a

    Alex

    08/31/2021, 10:38 AM
    Super brief question: Is arrow multiplatform ready yet? I heard something about one year ago that this was on the roadmap, haven't checked back since.
    👀 1
    s
    • 2
    • 9
  • m

    mitch

    08/31/2021, 12:00 PM
    qq, i noticed that Nullables have
    Nullable.zip
    but it doesn’t have the extension function
    public inline fun <A, B, Z> A?.zip(b: B?, fn: (A, B) -> Z): Z?
    i’m quite sure arrow devs have a good reason behind this..?
    s
    • 2
    • 3
  • m

    mitch

    08/31/2021, 12:08 PM
    as well, on zip’s syntax
    eitherA.zip(eitherB, ::fn)
    Is an alternate syntax like below also planned to be supported?
    Either.zip(eitherA, eitherB, ::fn)
    for instance, in reactor you have both
    Mono.zip(monoA, monoB, ::fn)
    and
    mono.zip(other, ::fn)
    👍 1
    s
    • 2
    • 12
  • m

    mitch

    08/31/2021, 12:25 PM
    @simon.vergauwen i find it difficult to adjust with your profile without beard
    🤣 6
    s
    b
    • 3
    • 8
  • a

    addamsson

    08/31/2021, 6:54 PM
    Hi there! Is #arrow multiplatform yet?
    m
    • 2
    • 1
  • a

    addamsson

    08/31/2021, 6:54 PM
    i'm looking at
    io.arrow-kt:arrow-core:0.13.2
    but I don't see the multiplatform modules
    s
    j
    • 3
    • 26
  • z

    Zyle Moore

    09/02/2021, 2:26 AM
    Hello, I have a question about Either type resolution/conventions when it comes to errors, and Sum Types.
    p
    s
    • 3
    • 8
  • m

    Michael Kaiser

    09/02/2021, 11:12 AM
    Hi, I have a question regarding Optics I was reading https://arrow-kt.io/docs/optics/dsl/ and wanted to try the first examle (Street, Address, Company, Employee data classes) but it doesn't work as in the documentation. When I leave the example as is, I get the error:
    error: @optics annotated class com.example.Player needs to declare companion object.
    In my build.gradle I added the following dependencies:
    implementation("io.arrow-kt:arrow-optics:0.13.2")
        kapt("io.arrow-kt:arrow-meta:0.13.2")
    Am I doing something wrong or is this just missing in the example code snippet? In this question https://stackoverflow.com/questions/58243913/arrowkt-optics-annotation-not-generating-code they use arrow 0.10.0 and here it is still required and it looks to me, that back then it was still in the documentaion. So I would guess, that the companion object isn't required anymore in 0.13.2. Or am I wrong?
    s
    s
    • 3
    • 5
  • z

    Zyle Moore

    09/03/2021, 5:16 AM
    Hello, I found a cross-browser issue with the documentation. Not sure of the scope affected, looks like potentially a small impact.
    • 1
    • 3
  • z

    zpearce

    09/04/2021, 5:32 PM
    Hi! I have a data class that I’m generating optics on like this. But I’m finding that I now need to add a lot more constructor params to it. So I’m hitting the error “Iso generation is supported for data classes with up to 22 constructor parameters.” What’s the quickest way around this? Is there a way to tell arrow to ignore some params?
    s
    m
    • 3
    • 8
  • d

    dimsuz

    09/07/2021, 2:23 PM
    Hi all. This maybe a lame question, but how "heavy" is Arrow Optics? I mean dependency wise, method count wise etc. We are evaluating adding it to our Android project (because copy-copy-copy... enough is enough!), but a bit afraid of Arrow size. Never used it before. Also, how will it be performance wise considering Android? I suspect everything will be OK.
    r
    s
    • 3
    • 7
  • r

    Randall Perry

    09/07/2021, 3:56 PM
    Hello all, new to the channel. I’m working with the “Functional Programming in Kotlin” book by Manning. Though this book was just finalized in August, they appear to be using some deprecated Arrow library code in their code examples. Here’s an example from Chapter 6: Listing 6.18. State propagation using a for-comprehension
    val ns2: State<RNG, List<Int>> =
       State.fx(Id.monad()) { 
           val x: Int = int.bind() 
           val y: Int = int.bind() 
           val xs: List<Int> = ints(x).bind() 
           xs.map { it % y } 
       }
    Using latest Arrow libs, the above snippet fails syntax checker in Idea. ‘Id’ is not recognized, and Arrow docs say it was slated for deprecation. Wondering if anyone can help refactor this to current Arrow version, or recommend previous version this will work with? Asked on Manning forum, but got no reply.
    r
    m
    • 3
    • 7
  • m

    mitch

    09/11/2021, 2:13 AM
    Hi team! I have a question around delimited continuations. Context: I’m trying to use arrow continuation to convert the ergonomics of an internal data structure that I have in some internal project. It’s somewhat a kleisli, which shape looks like the following:
    data class ExecutionPlan<out A>(val runPlan: suspend (PlanConfig) -> A) {
      fun <B> flatMap(fn: (A) -> ExecutionPlan<B>): ExecutionPlan<B> = ...
    
      // map, zip, traverse
      // etc...
    }
    Prior to arrow 0.13 it was leveraging
    ExecutionPlan.monad().fx { … }.fix()
    Now that is not available anymore and I’ve refactored the code to nested flatMaps.. which proliferated in the codebase, and is causing some pain..
    // what we have now:
    val plan = planA.flatMap { a ->
      planB.flatMap { b ->
        planC(a, b).flatMap { c ->
          // ...
        }
      }
    }
    
    // what we want:
    val plan = executionPlan { 
      val a = planA.bind()
      val b = planB.bind()
      val c = planC(a, b).bind()
      c
    }
    I’m wondering how i might leverage delimited continuation to implement this?
    fun interface ExecutionPlanEffect<E, A> : Effect<ExecutionPlan<A>> {
      suspend fun <B> ExecutionPlan<B>.bind(): B = ???
    }
    thanks!!
    s
    • 2
    • 3
  • r

    Robert Menke

    09/11/2021, 6:25 PM
    Forgive me, I’m coming back to android after some time away. I’ve updated to the latest stable version of Arrow (0.13.2) and I’m trying to use monad comprehensions. I’m running into an issue where
    bind
    is not defined. I’m currently using core, optics, and meta (via kapt). What am I doing wrong?
    s
    • 2
    • 12
  • j

    Jeff

    09/15/2021, 6:17 AM
    Is there a way to call Validated.zip on an Iterable instead of one of the overloaded forms? Is this a JVM optimization (I’ve seen Clojure do similar overloading instead of vararg). eg.
    val someIterable : List<Validated<MyError, String>> // from a map or something similar
    someIterable.zip(Semigroup.nonEmptyList<MyError>()} {array -> ... }
    //or
    Validated.zip(someIterable, se) {array -> ... }
    I’m borrowing Rx’s api for zips / FuncN for f. Is this a JVM optimization? (I’ve seen Clojure do similar overloading instead of a single vararg form)
    s
    • 2
    • 5
  • v

    Ville Peurala

    09/15/2021, 11:17 AM
    Hi, and sorry for the probably dumb question, but where is
    Applicative
    in the latest release? Or what should I use instead?
    s
    v
    r
    • 4
    • 8
  • l

    Lidonis Calhau

    09/17/2021, 9:38 AM
    Is there an official date release for Arrow 1.0? I would like to write an article about Arrow and time it with the release of 1.0
    🎉 2
    :arrow: 3
    👍🏻 2
    👏 2
    👍 1
    s
    t
    +2
    • 5
    • 17
  • i

    ivanmorgillo

    09/19/2021, 10:55 AM
    Hi all, I would like to report/fix some formatting issue in the doc
    r
    s
    p
    • 4
    • 14
  • m

    Marc

    09/20/2021, 6:41 AM
    Hello people: I’m wondering if it would be possible to use Arrow in a Multiplatform project
    s
    r
    +2
    • 5
    • 26
  • m

    Marc

    09/20/2021, 6:58 AM
    2nd question: Dos anyone can tell how weight is Arrow in Kb’s?
    s
    • 2
    • 2
  • s

    stojan

    09/20/2021, 1:08 PM
    https://media0.giphy.com/media/whT4OfSgMsfHW/giphy.gif?cid=ecf05e47n0jzjk2nqmga59ueh0egzvqrr0tip5rylcpx9hkq&amp;rid=giphy.gif&amp;ct=g
    🎉 10
    i
    r
    +4
    • 7
    • 11
  • j

    jean

    09/21/2021, 7:19 AM
    Do you guys have an explicit list of supported targets for KMM? I’m running in this issue right now :
    Could not find io.arrow-kt:arrow-core-iosx64:unspecified
    s
    • 2
    • 4
  • t

    than_

    09/21/2021, 10:56 AM
    Now that Arrow is MP. How does optic generation work? In getting started I'm being told to use kapt. That'd work only for JVM wouldn't it?
    s
    r
    c
    • 4
    • 4
Powered by Linen
Title
t

than_

09/21/2021, 10:56 AM
Now that Arrow is MP. How does optic generation work? In getting started I'm being told to use kapt. That'd work only for JVM wouldn't it?
s

simon.vergauwen

09/21/2021, 11:00 AM
Hey @than_, That’s correct. The Arrow guide still recommends
kapt
since Arrow Meta has not been released yet. It follows an independent cycle but should become available this year too. I’m not sure if it’s possible yet to consume the Optics plugin from Arrow Meta, it does the same thing as
kapt
but MPP. cc\\ @raulraja
r

raulraja

09/21/2021, 11:03 AM
We need to work on a release for it but once it does it should work mpp. I believe there is currently a remaining issue related to where generated sources are placed
t

than_

09/21/2021, 11:53 AM
Thanks for clarification. Congratulations for 1.0.0 btw 🙂
🥳 1
c

Cody Mikol

09/21/2021, 2:24 PM
didn’t even realize it hit 1.0.0 🎉 🎉🎉
🥳 1
View count: 6