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

    pakoito

    03/29/2019, 11:15 AM
    should be already available if you have the extensions module
    j
    • 2
    • 1
  • j

    Jannis

    03/29/2019, 11:38 AM
    just realized any is a terrible name in kotlin
    s
    • 2
    • 3
  • d

    David Podhola

    03/31/2019, 5:46 AM
    Hi, is it only me who would use a function to clear the `memoize`d cache like https://clojure.github.io/core.memoize/#clojure.core.memoize/memo-clear! or should I go some simpler way and e.g. restart the application?
    r
    • 2
    • 6
  • i

    Imran/Malic

    03/31/2019, 8:55 AM
    Can someone give me a minimal example for Free (PUN intended)?
    j
    r
    • 3
    • 83
  • s

    simon.vergauwen

    04/02/2019, 4:56 PM
    I.e.
    sequence: (List<Option<A>>) -> Option<List<A>>
    which yields
    Some
    if all options were
    Some
    or
    None
    if one of them was empty.
    e
    • 2
    • 4
  • s

    streetsofboston

    04/04/2019, 4:36 PM
    IO, BIO, ZIO 🙂 Sorry, couldn’t resist
    p
    a
    r
    • 4
    • 3
  • r

    raulraja

    04/05/2019, 10:19 AM
    The current proposed names looks like the following. Note this is not the actual impl but just the names.
    CatchIO<E, A> // base IO that has built in bifunctor and its parametric to E
    typealias IO<A> = CatchIO<Throwable, A>
    typealias EnvIO<R, E, A> = R.() -> IO<E, A>
    We are open to new names or suggestions that are easy for users so feel free to comment on this message in a thread and we can look into different options
    🤔 1
    i
    p
    s
    • 4
    • 12
  • p

    pakoito

    04/05/2019, 1:55 PM
    I'm in favor of keeping just EnvIO and make the other two an alias using
    Nothing
    for the fields they don't use.
    r
    s
    • 3
    • 14
  • i

    ivanmorgillo

    04/05/2019, 5:57 PM
    r
    • 2
    • 15
  • a

    AdrianRaFo

    04/11/2019, 11:02 AM
    The
    @extension
    export the extension functions from a type class
    interface Functor<F> {
      fun <A, B> Kind<F, A>.map(f: (A) -> B): Kind<F, B>
    }
    to inheritors
    @extension interface IOFunctor : Functor<ForIO> {
      override fun <A, B> Kind<ForIO, A>.map(f: (A) -> B): IO<B> =
        fix().map(f)
    }
    i
    • 2
    • 5
  • i

    ivanmorgillo

    04/12/2019, 8:25 AM
    hi all, can you point me to an example of mixing Option and Either binding, please? I'm struggling with some inference errors 🤔
    r
    • 2
    • 1
  • i

    Imran/Malic

    04/12/2019, 7:57 PM
    Am I the only one who see’s this in gradle?
    r
    s
    • 3
    • 6
  • p

    pakoito

    04/13/2019, 2:52 PM
    hkts aren’t part of the proposal anymore
    k
    • 2
    • 2
  • r

    raulraja

    04/14/2019, 11:36 AM
    Also the improvements of freeing you from inheritance all together if you choose to not use sub typing and encouraging horizontal composition and separation of data and behaviors.
    i
    t
    • 3
    • 21
  • s

    Sergio Crespo Toubes

    04/16/2019, 3:41 PM
    override fun getElements(): Either<Throwable, List<Element>> {
    	return elementsApi.getElements(authToken)
    		.async(IO.async())
    		.fix()
    		.unsafeRunSync()
    		.unwrapBody(Either.applicativeError())
    		.fix()
    }
    This is working for me, but is the good way for using arrow with retrofit?
    getElements
    return CallK object.
    r
    s
    • 3
    • 9
  • t

    than_

    04/18/2019, 9:09 AM
    hi is there any way to operate on
    Kind<F,A>
    type for example to map it to
    Kind<F,B>
    ?
    d
    • 2
    • 1
  • i

    Imran/Malic

    04/18/2019, 2:17 PM
    0.9.1 is the latest
    r
    • 2
    • 1
  • k

    kluck

    04/18/2019, 3:01 PM
    @raulraja Sorry, but I don't understand how to use your link ^^. When I follow it, I get the correct documentation, but I can't see where I should go to query the apidocs myself. The top "Search documentation..." field only gives me answers inside the "regular" documentation, not the apidocs…
    r
    • 2
    • 4
  • k

    kluck

    04/19/2019, 2:34 PM
    Hi, I'm trying to get my head around using IO (I'm "leveling up" from simply using Either 😛 ). I'm a bit stuck with how/when to actually execute my IO. For example, let's say I have a retrofit api with this signature:
    fun getStore(): CallK<StoreDto>
    . On the repository layer, I'd like to obtain a Store, but as it might come from the network, I guess it should be wrapped in an IO like so:
    fun getStore(): IO<Store>
    . My problem resides in the fact that I don't find where I should do my mapping from StoreDto to Store. I have something like this for now:
    kotlin
            apiCall.async(IO.async())
                .fix()
                .unsafeRunAsync { either ->
                    either.fold( // <-- the result of this is what I'd like to get
                        { IO.raiseError<Store>(it) },
                        { retrofitResponse ->
                            retrofitResponse.unwrapBody(Either.applicativeError()).fix().fold(
                                { IO.raiseError(it) },
                                { storeDto -> IO.just(Store(storeDto.name)) }
                            )
                        }
                    )
                }
    But this actually execute the code at the repository level, and doesn't return my expected type. I'd like to actually execute this at a higher level, say my android activity in my presentation layer. Any tips on what direction I should take? I'm trying to get inspiration from https://github.com/JorgeCastilloPrz/ArrowAndroidSamples , but I don't understand all that is done there at the DataSource level…
    r
    k
    +3
    • 6
    • 39
  • i

    Imran/Malic

    04/19/2019, 9:09 PM
    I released the very first version of Arrow Docset 0.0.1 , which acts as a productivity tool to get you started with arrow and helps those who uses Arrow on a daily bases to integrate it efficiently in their workflow. Check out the repo and I welcome PR’s :arrow: https://github.com/i-walker/Arrow-Docset/releases Happy Easter😬
    :arrow: 2
    👏 2
    r
    • 2
    • 3
  • i

    Imran/Malic

    04/20/2019, 8:28 AM
    so we get a String (City) then we make a request to our DB(with host and port) if our database does not have the city name available we call 3th party app which results us the Weather forcast of that given city // I am trying to transfer some scala code to kotlin, because there are so source examples on how to use tagless final, but thats another convo.
    s
    • 2
    • 26
  • p

    pakoito

    04/21/2019, 2:26 AM
    handle exception throwing
    There’s
    Try
    , and we’re on the way of deprecating it in favor of
    Fx
    :arrow: 1
    😱 2
    r
    • 2
    • 1
  • i

    Imran/Malic

    04/21/2019, 8:22 PM
    I am hyped to announce the 0.1.0 version of Arrow-Docset. Giving you a powerful search-engine. Try it out for yourself! https://github.com/i-walker/Arrow-Docset Now it supports: ( supported before - arrow-playground - Guides on the arrow page ) - Type classes - classes - Functions - Types - Packages
    👏 14
    r
    • 2
    • 2
  • s

    starke

    04/23/2019, 3:06 PM
    is there a simple way to do something like add two
    Option<Int>
    values?
    m
    a
    +4
    • 7
    • 26
  • s

    simon.vergauwen

    04/26/2019, 8:07 AM
    val c = a.flatMap { aRight ->
      b.map { bRight ->
        bRight + aRight.toString()
      }
    }
    👍 1
    s
    • 2
    • 1
  • p

    pakoito

    04/26/2019, 3:28 PM
    https://github.com/arrow-kt/arrow/blob/master/modules/core/arrow-extras-extensions/src/main/kotlin/arrow/data/extensions/kleisli.kt#L136
    s
    • 2
    • 1
  • d

    dewildte

    04/27/2019, 3:37 AM
    Has anyone have an example of dependencies for arrow version
    0.9.1-SNAPSHOT
    in a
    build.gradle.kts
    file?
    i
    • 2
    • 2
  • b

    Bob Glamm

    04/29/2019, 12:34 PM
    IntelliJ seems to fail not infrequently on Arrow code
    s
    • 2
    • 3
  • t

    Trevor

    04/29/2019, 11:52 PM
    Do folks use the Kotlin REPL when developing? I'm trying to see if I can get it to kinda mirror what I would expect to do in Clojure and stuff, but IDEA doesn't appear to have any commands that let me send code to the REPL and such. Resources on the topic appear sparse, any insights I might be missing?
    g
    • 2
    • 3
  • p

    pakoito

    04/30/2019, 9:48 AM
    yeah that works too, and it may actually work better because I don’t remember if we skipped the continueOn and other operators until an error handler was found
    s
    • 2
    • 1
Powered by Linen
Title
p

pakoito

04/30/2019, 9:48 AM
yeah that works too, and it may actually work better because I don’t remember if we skipped the continueOn and other operators until an error handler was found
s

simon.vergauwen

05/01/2019, 9:01 PM
Yes, we skip until an error handler is found.
🔝 1
View count: 2