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
arrow
  • s

    sam

    06/06/2019, 4:29 PM
    does something like that exist ?
    k
    i
    • 3
    • 10
  • s

    sam

    06/06/2019, 7:13 PM
    are there some guidelines on writing your own typeclasses
    s
    • 2
    • 13
  • s

    sam

    06/06/2019, 7:14 PM
    so I want the kotlin version of declaring an
    implicit Fibble[T]
    s
    • 2
    • 51
  • r

    Robert Menke

    06/06/2019, 7:19 PM
    Hey, is there something like
    switchMap
    in Arrow that can be used for scenarios like this:
    Option
        .fromNullable(someValue)
        .map { /* calls a function that returns Either<Error, Value> */}
    After calling map I have
    Option<Either<Error, Value>>
    wondering if there’s any way to avoid the extra wrapping. CC @Derek Seroky
    k
    i
    • 3
    • 4
  • b

    Bob Glamm

    06/07/2019, 1:51 PM
    Hmm, it's probably relatively straightforward to provide extension functions on types (.toCats/.fromCats) but I wonder if it's possible to compose algebras ... I guess probably not in general because no joint Scala/Kotlin compilation engine exists
    r
    • 2
    • 1
  • p

    pakoito

    06/08/2019, 4:28 PM
    remember the coversation we had the other day
    s
    • 2
    • 4
  • p

    pakoito

    06/08/2019, 4:42 PM
    .toEither()
    s
    • 2
    • 24
  • p

    pakoito

    06/08/2019, 7:15 PM
    and there will be some that won’t fit the bill, i.e. you wouldn’t use a List for Async. You simply cannot implement the interface in a way that passes the test suite that comes with Async.
    d
    • 2
    • 1
  • s

    sam

    06/09/2019, 5:40 PM
    I couldn't find it
    r
    • 2
    • 1
  • s

    sam

    06/10/2019, 5:08 PM
    what does suspend have to do with it
    r
    • 2
    • 19
  • p

    pakoito

    06/10/2019, 6:54 PM
    0.9.0?
    s
    • 2
    • 2
  • p

    pakoito

    06/10/2019, 6:55 PM
    do
    IO.fx
    s
    • 2
    • 6
  • b

    Bob Glamm

    06/11/2019, 8:28 PM
    Really need an #arrow-support channel for all of us plebes stuck staring at plain Java code that (for example) returns an un-bracketed
    InputStream
    while we know full well that what we really want there is
    IO.bracket(...)
    m
    • 2
    • 1
  • e

    earroyoron

    06/13/2019, 7:22 PM
    newbi question again Well, here I go again… I found pretty good this blog to understand monads and functors, etc. https://medium.com/beingprofessional/understanding-functor-and-monad-with-a-bag-of-peanuts-8fa702b3f69e But I am not sure if kotlin
    map
    6
    flatMap
    is just the same as explained there?
    b
    r
    +2
    • 5
    • 13
  • k

    kioba

    06/14/2019, 3:20 PM
    https://twitter.com/JakeWharton/status/1139530246041022465?s=08
    👍 2
    s
    r
    +2
    • 5
    • 10
  • p

    pakoito

    06/17/2019, 9:18 AM
    those will be executed one after another, I believe in 0.9 it’s second, first, third and Simon fixed it for 0.10 to be first, second, third
    s
    • 2
    • 3
  • s

    sam

    06/17/2019, 10:16 PM
    What's the difference between
    "myerror".left()
    and
    "myerror".raiseError()
    ?
    r
    • 2
    • 2
  • s

    simon.vergauwen

    06/18/2019, 1:37 PM
    You can combine
    Applicative.map
    . Below is an example of combining 4 values by only using map with 2 params. Hope that helps :)
    Validated.applicative().map(
      Validated.applicative().map(a, b, ::Tuple2),
      Validated.applicative().map(c, d, ::Tuple2) 
    ) { (a, b), (c, d=) -> ... }
    :arrow: 5
    ☝️🏼 4
    j
    r
    • 3
    • 4
  • m

    Marcin Gryszko

    06/19/2019, 5:37 AM
    What's the best way to wrap a coroutine in
    IO
    ? (I'm a bit lost in the forest of
    IO
    ,
    Async
    and
    fx
    constructors and combinators). Take this example:
    suspend fun getCoroutines(internalHotelId: Int): Either<Throwable, CustomerFeedback?> { ... }
    I'd like to execute it asynchronously. This is my take:
    fun getIOAsync(internalHotelId: Int): IO<CustomerFeedback?> =
        IO.async().async { callback ->
          GlobalScope.launch {
            val result = GlobalScope.async { getCoroutines(internalHotelId) }.await()
            callback.invoke(result)
          }
        }
      }
    Is this the correct way? Are there any other ways? Can this be achieved with
    fx
    and
    effect
    ?
    r
    • 2
    • 3
  • k

    kluck

    06/19/2019, 7:07 AM
    Hi, is there a cleaner way to do this:
    class InMemoryStorePersistentSource : IStorePersistentSource {
    
        private var store: IO<Option<Store>> = IO { None }
    
        override fun getCurrentStore(): IO<Option<Store>> = store
        override fun persistCurrentStore(store: Option<Store>): IO<Unit> = IO { this.store = IO { store } }
    }
    r
    p
    • 3
    • 4
  • b

    Bob Glamm

    06/19/2019, 5:28 PM
    also Kotlin 1.3.40 plugin for IJ includes the new type inference engine. Time to see if I can crash the GC!
    p
    s
    s
    • 4
    • 19
  • d

    Derek Berner

    06/19/2019, 5:32 PM
    Is it possible to extend ReceiveChannels into Traversable?
    s
    • 2
    • 12
  • d

    Derek Berner

    06/20/2019, 8:24 PM
    And there's no
    Fx
    instance for
    EitherT
    s
    p
    r
    • 4
    • 29
  • f

    farzad

    06/21/2019, 12:07 PM
    I’m confused about what is
    Functor
    ,
    Applicative
    and
    Monad
    . How do you explain these terms for a programmer with OOP background/terminology?
    p
    d
    • 3
    • 18
  • i

    Imran/Malic

    06/23/2019, 10:46 AM
    Is there something like fun composed() = f() andThen g() andThen c()
    r
    s
    d
    • 4
    • 6
  • p

    pablisco

    06/24/2019, 7:58 AM
    For FP you have this one: https://github.com/spebbe/dartz I started doing a version of arrow for dart here: https://github.com/arrow-kt/cork There you can find some data type implementations. I don't have any plans currently to add support just yet, although may be in the future if there is interest.
    😍 1
    k
    • 2
    • 1
  • s

    streetsofboston

    06/24/2019, 3:34 PM
    @raulraja How to you rewind/restore the stack when dealing with observables that can run on different dispatchers/schedulers… That must not be easy to do…
    r
    • 2
    • 5
  • r

    Ryan Benasutti

    06/24/2019, 3:35 PM
    Can you distribute a compiler plugin with the current artifacts so we still just need to include a few maven dependencies?
    r
    • 2
    • 1
  • b

    Brandon Ward

    06/24/2019, 5:38 PM
    Does arrow have anything to handle a finally block? Something like
    Try.invoke{canThrow()}.finally{cleanup()}
    i
    r
    • 3
    • 3
  • b

    Brandon Ward

    06/24/2019, 5:44 PM
    This is within a testing framework perspective, and the
    canThrow()
    is a block of assertions, and the
    cleanup()
    is some test cleanup
    i
    • 2
    • 2
Powered by Linen
Title
b

Brandon Ward

06/24/2019, 5:44 PM
This is within a testing framework perspective, and the
canThrow()
is a block of assertions, and the
cleanup()
is some test cleanup
i

Imran/Malic

06/24/2019, 5:49 PM
WHat kind of assertions?
I am just checking if there are pure or not
View count: 4