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
  • r

    Robert Menke

    07/20/2019, 4:05 PM
    Is there an existing utility/extension function that converts
    R?
    to
    Either<L, R>
    ? Something like
    fun <L, R> R?.toEither(f: () -> L): Either<L, R> {
        return Option
            .fromNullable(this)
            .toEither(f)
    }
    ☝️🏼 1
    i
    p
    • 3
    • 4
  • p

    pakoito

    07/20/2019, 10:42 PM
    Try
    IO.fx
    👍🏻 1
    k
    r
    i
    • 4
    • 3
  • r

    rcd27

    07/21/2019, 9:38 AM
    Trying to build
    arrow
    , but have
    Building with a JRE or JDK9 is currently not supported.
    . Which one do I need? 11?
    k
    i
    • 3
    • 3
  • k

    kitttn

    07/21/2019, 10:42 AM
    Do we have any public real-world examples of arrow usage? Like Android apps, etc. Especially interested in Fx, but since it’s relatively new, tagless-final style can work as well.
    👍 1
    r
    • 2
    • 4
  • r

    rcd27

    07/21/2019, 5:00 PM
    Learning FP with arrow... The more I understand its logic, the less I understand this one: why did we need OOP at all?!
    k
    b
    • 3
    • 4
  • r

    rcd27

    07/21/2019, 5:58 PM
    Can't understand, why the brackets around
    a
    solve the compile-time problem:
    binding {
      val (a) = IO.invoke { 1 }
      a + 1
    }.fix().unsafeRunSync()
    // 2
    k
    s
    r
    • 4
    • 4
  • j

    jacob

    07/21/2019, 11:35 PM
    hey 👋 talk I gave on FP in kotlin went up

    https://www.youtube.com/watch?v=aTUa_qlmoh8▾

    I'm giving a similar talk soon, if anyone ends up watching it and has feedback for me I'd love to hear it.
    ❤️ 9
    💯 3
    r
    r
    • 3
    • 7
  • c

    carbaj0

    07/22/2019, 7:49 AM
    let's say that in an android application i call the IO fx block, but the user moves to another screen before it is finished
    s
    • 2
    • 2
  • s

    simon.vergauwen

    07/22/2019, 8:33 AM
    Untitled.kt
    😍 3
    🔝 2
    :arrow: 2
    c
    k
    • 3
    • 18
  • t

    than_

    07/22/2019, 11:55 AM
    hi, what import should I use when I want to use
    val fx: Fx<ForIO> = IO.fx()
    ? from docs it should be
    import arrow.effects.extensions.io.fx.fx
    but
    arrow.effects.extensions.io.fx
    doesn't seem to exist. I'm using 0.9.1-SNAPSHOT
    i
    s
    • 3
    • 13
  • p

    pakoito

    07/22/2019, 9:39 PM
    My SO account is RIP, could anyone please jump into this question? https://stackoverflow.com/questions/57153396/how-to-use-arrows-type-classes
    s
    • 2
    • 3
  • r

    rcd27

    07/24/2019, 5:52 AM
    Probably I'm not the first one: what about kotlin-arrow GSON retorfit converter which could convert Nullable types to Option?
    p
    • 2
    • 1
  • p

    pakoito

    07/24/2019, 10:40 AM
    clean up your build, should be fixed
    ☝️ 1
    c
    • 2
    • 2
  • b

    Bob Glamm

    07/24/2019, 5:23 PM
    I get that the call chain gets deep quickly recursing like that
    s
    • 2
    • 1
  • p

    pakoito

    07/24/2019, 5:40 PM
    T isn't a collection, so we don;t know where that prepend to comes from
    s
    • 2
    • 1
  • b

    Bob Glamm

    07/24/2019, 6:27 PM
    That does worry me a little bit, the docs https://arrow-kt.io/docs/effects/fx/ indicate using
    IO {...}
    in conjunction with
    effect {...}
    but ^^ the example above gets to SOE pretty quickly when attempting to use the two together
    p
    s
    • 3
    • 57
  • b

    Bob Glamm

    07/24/2019, 6:38 PM
    and it does complain if I do something like
    tailrec suspend fun factorial(n) = if(n == 1) { 1 } else { n * factorial(n - 1) }
    p
    • 2
    • 5
  • s

    simon.vergauwen

    07/24/2019, 6:52 PM
    I just remembered we did some fixes in IO related to stack safety but those aren't released yet either :/
    🔝 1
    p
    • 2
    • 3
  • k

    kitttn

    07/25/2019, 8:43 AM
    Guys, i just can’t stop saying HOW AMAZINGLY this
    suspend
    plays with IO and FP. Did you write any papers about it already? I can see it as a contribution to the science
    ❤️ 5
    r
    • 2
    • 2
  • p

    pakoito

    07/25/2019, 9:03 AM
    are you in 0.10 already?
    k
    • 2
    • 1
  • p

    pakoito

    07/25/2019, 2:23 PM
    if someone else would be to step up, I can mentor 😉
    s
    r
    • 3
    • 5
  • m

    Miguel Coleto

    07/25/2019, 2:53 PM
    In fact there is someone who is already playing with these concepts and SwiftUI and it looks really nice
    p
    • 2
    • 4
  • s

    streetsofboston

    07/25/2019, 3:03 PM
    @Miguel Coleto What we noticed is that most (not all) of our mobile (Android) apps we make have very little business logic. That is all on the server. And business logic would be the prime target for coding it in FP. Most of the code deals with the ‘edge of the world’: UI/Services on top; Network, Cache, File, BLE, etc on the bottom. There is very little code in the middle: ViewModel and datasources (and some UI validation)
    m
    s
    r
    • 4
    • 9
  • i

    Imran/Malic

    07/28/2019, 11:19 AM
    I am having some type inference issues in MTL.
    import arrow.core.Id
    import arrow.core.ListK
    import arrow.core.Option
    import arrow.core.extensions.id.applicative.applicative
    import arrow.core.extensions.list.traverse.traverse
    import arrow.mtl.Reader
    import arrow.mtl.extensions.kleisli.applicative.applicative
    
    interface Context
    interface Topic
    interface Result
    
    typealias Job<A> = Reader<Context, A>
    
    fun processTopic(t: Topic): Job<Result> = TODO()
    fun processTopics(topics: ListK<Topic>) = // The compiler bails here
      topics.traverse(Job.applicative(Id.applicative())) {
        processTopic(it)
      }
    Can someone help me out?
    r
    • 2
    • 2
  • p

    pakoito

    07/28/2019, 1:35 PM
    and follow the compiler’s suggestions
    i
    • 2
    • 1
  • l

    liminal

    07/28/2019, 10:28 PM
    i have an android kotlin project that relies heavily on rxjava. as far as a kotlin projects go, it’s using a lot of FP constructs (stream manipulations, immutability is important, etc.) do you think throwing arrow-kt in the mix would be helpful? does anyone successfully use this combo?
    p
    r
    t
    • 4
    • 14
  • c

    carbaj0

    07/29/2019, 6:05 AM
    https://speakerdeck.com/lelandrichardson/react-meet-compose
    🔝 1
    p
    • 2
    • 2
  • p

    pakoito

    07/29/2019, 8:33 AM
    Nice! If you want something really powerful I’d consider supporting unions/sealed classes
    s
    • 2
    • 24
  • t

    Tim Fennis

    07/29/2019, 8:56 AM
    Hey since there aren’t stupid questions... Why does
    foldRight
    on
    Either
    make use of an
    Eval<C>
    ?
    p
    • 2
    • 2
  • t

    than_

    07/29/2019, 9:41 AM
    Hi, it seems Coproduct is missing from current 0.10.0-SNAPSHOT. Is that a mistake or was it deprecated? Or it might be error on my part 🙂
    p
    • 2
    • 8
Powered by Linen
Title
t

than_

07/29/2019, 9:41 AM
Hi, it seems Coproduct is missing from current 0.10.0-SNAPSHOT. Is that a mistake or was it deprecated? Or it might be error on my part 🙂
p

pakoito

07/29/2019, 10:26 AM
There were 2 coproducts, one of them got nuked. I'm on the phone so could you please do a filename search on the repo
It may have moved from core to meta or the other way around
t

than_

07/29/2019, 10:56 AM
File search in repo indeed finds Coproduct https://github.com/arrow-kt/arrow/blob/ce539f2c807683eb937190dfcdb76ddd2db75cad/modules/core/arrow-generic/src/main/kotlin/arrow/generic/Coproduct.kt but it doesn't seem to be present in any JARs (my arrow dependencies are below).
dependencies
p

pakoito

07/29/2019, 11:06 AM
implementation("io.arrow-kt:arrow-generic:$arrowVersion")
hmmmm
but that's not what you want
@raulraja do you remember what we did here?
t

than_

07/29/2019, 5:08 PM
thanks, the missing import did the trick 🙂
👍🏼 2
View count: 3