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

    Jorge Castillo

    10/17/2019, 5:53 PM
    https://jorgecastilloprz.github.io/please-try-to-use-io
    :arrow: 5
    🔝 4
    r
    • 2
    • 3
  • g

    ghedeon

    10/18/2019, 7:50 AM
    Never used Arrow before but trying to improve my error handling and excited about Railway Oriented Programming. To keep it practical, how do you model your http request response with Arrow? I've seen something "Use
    Try
    in data layer, then map to
    Either
    for domain". Am I on the right track? Any good hands-on articles, like "Retrofit + Arrow, error handling"? Thank you.
    g
    p
    s
    • 4
    • 11
  • t

    thanh

    10/18/2019, 8:44 AM
    the Arrow Meta talk will start soon!
    :arrow: 13
    k
    i
    v
    • 4
    • 4
  • f

    Francesco megna

    10/20/2019, 3:24 PM
    I'm trying to port RemoteData to Koltin, any feedback is welcome 😄 https://gist.github.com/effe-megna/e84f5fb313daa6c5484cc07f02813bbe#file-remotedata-kt
    p
    r
    • 3
    • 36
  • p

    pakoito

    10/20/2019, 3:34 PM
    @Francesco megna it’s more broken than we thought
    f
    r
    • 3
    • 3
  • p

    pakoito

    10/20/2019, 3:34 PM
    use flatMap(::identity) for now
    👍🏾 1
    f
    a
    • 3
    • 10
  • r

    raulraja

    10/20/2019, 10:44 PM
    https://twitter.com/_JamesWard/status/1185949090456199171?s=19
    👏🏼 5
    r
    • 2
    • 1
  • h

    HarryPulvirenti

    10/21/2019, 8:34 AM
    Hi guys, I’m working with coroutine and Either and I faced a problem with the flatMap of either.
    suspend fun findLocation() = coroutineScope {
            locationDelegate.checkSettings().flatMap {
                locationDelegate.getLocation()
            }
        }
    In this sample, I can’t call
    locationDelegate.getLocation()
    since the
    getLocation()
    is a suspend function. How can I handle suspend functions in
    flatMap
    since it is not an inline function?
    r
    • 2
    • 5
  • j

    jimn

    10/22/2019, 1:39 AM
    what is the most FP arrowy kotlin redux that ppl in here like?
    r
    • 2
    • 11
  • t

    Tom Hall

    10/22/2019, 4:05 PM
    Hi - sorry for the shameless plug but we are looking for a Senior Android Developer here at Permutive in London - pm me if you are interested or would like more information. Someone with Arrow experience would be a great fit (we are using Arrow to a certain degree in our Android platform & we use Scala Cats/Http4s on our servers & Haskell, too). You can get the details here: https://apply.workable.com/permutive/j/F5DC7F5054/
    :arrow: 3
    😍 2
    j
    • 2
    • 1
  • r

    Ryan Benasutti

    10/23/2019, 1:12 AM
    Is there something like
    IO
    (lazy, safe, etc.) that does not use
    Throwable
    for the error type? My main issue is that
    IO.raiseError
    needs a
    Throwable
    and in my use case, constructing a stacktrace is too expensive.
    r
    a
    r
    • 4
    • 6
  • p

    Pagoda 5b

    10/23/2019, 4:30 AM
    any hint?
    a
    • 2
    • 8
  • m

    Matt Thiffault

    10/23/2019, 5:19 AM
    Silly question, is there a concise way to force an expression to have Unit return value? Eg, sometimes the last thing I want to do in an IO block is log something, but Android Log.* methods return integers for some reason not described in the API documentation. I feel silly adding an extra line just for "Unit" to fix the return type.
    j
    a
    • 3
    • 2
  • p

    Pagoda 5b

    10/23/2019, 6:55 AM
    you might usually want some form of
    .void()
    function for any
    Functor
    that does nothing more than
    Functor.map(it -> ())
    👍 1
    r
    • 2
    • 1
  • r

    raulraja

    10/23/2019, 12:00 PM
    Still you can use
    Either.catch
    but really you should be using IO if you are dealing with effects
    y
    • 2
    • 1
  • p

    Pagoda 5b

    10/23/2019, 12:09 PM
    how do you plan to integrate nullables? is there some open discussion thread to have an idea of how it will look like?
    🤩 1
    r
    • 2
    • 14
  • p

    pakoito

    10/23/2019, 3:38 PM
    so there will be fewer
    fix()
    and
    sequence(Either.applicative())
    needed all around. Ideally not at all 🙂
    ❤️ 2
    d
    p
    • 3
    • 59
  • s

    Saša Šijak

    10/24/2019, 11:05 AM
    Somebody should write a book about arrow-kt 🙂 and with FP intro. It is really hard for someone to just jump in and learn arrow without proper explanations and good examples of idiomatic usages. I would buy that book right away 🙂
    👍 1
    p
    r
    • 3
    • 7
  • r

    raulraja

    10/24/2019, 11:14 AM
    🤩 12
    😍 11
    :arrow: 11
    🔥 3
    t
    s
    +2
    • 5
    • 6
  • p

    pakoito

    10/24/2019, 11:57 AM
    if you're in a suspend function you have
    Either.catch { }
    which accepts suspend functions inside too
    s
    • 2
    • 1
  • k

    karelpeeters

    10/24/2019, 8:50 PM
    A question about the
    operator fun invoke
    in `Either.Left`: why is it there? It looks like a constructor but I can't think of a case where the behavior would be different from just making the constructor public instead. It made sense for kategory when
    Either.Left
    had two type parameters so you wouldn't have to specify the
    Nothing
    type explicitly (https://github.com/JcMinarro/kategory/blob/master/kategory-core/src/main/kotlin/kategory/data/Either.kt#L125), but why does arrow have it too? (https://github.com/arrow-kt/arrow/blob/master/modules/core/arrow-core-data/src/main/kotlin/arrow/core/Either.kt#L818). For that matter, why did
    Either.Left
    ever have two type parameters in kategory?
    r
    p
    • 3
    • 18
  • j

    jimn

    10/26/2019, 1:06 PM
    https://github.com/47deg/helios/blob/master/helios-parser/src/main/kotlin/helios/parser/Parser.kt this looks like an arrow-kt json parser. I'm not yet sure what im looking for to understand how this diverges from a kotlin minimal effort.
    r
    s
    • 3
    • 11
  • j

    jimn

    10/26/2019, 1:53 PM
    @Jannis do you have a haskell -> jvm bytecode emitter?
    j
    • 2
    • 9
  • r

    Ryan Benasutti

    10/26/2019, 4:55 PM
    IO::bracket
    works well when you have something like this:
    IO { take a resource safely }.bracket(release = { give it back }, use = { use it in a way that can fail })
    but what about the case where taking the resource can also fail? Is there a method that can handle this, or do I need another
    bracket
    ?
    j
    s
    • 3
    • 6
  • a

    aballano

    10/27/2019, 5:19 PM
    according to the paper (https://functorial.com/the-future-is-comonadic/main.pdf) from which i guess it was implemented:
    4.2 Day Convolution
    Another common pattern is to display two user interfaces
    side-by-side, with their states evolving independently.
    A comonad to specify such an interface would again need
    to store all future states of both components, and we would
    also need a function to render any two current states. This
    data is captured by the Day convolution of the
    two functors
    s
    d
    r
    • 4
    • 5
  • p

    pakoito

    10/28/2019, 8:53 PM
    you may also want to do a PR against the libraries site
    s
    • 2
    • 1
  • f

    Francesco megna

    10/28/2019, 9:47 PM
    I'm trying to build arrow-kt project, forked from github, and i have this error
    A problem occurred evaluating project ':arrow-meta'.
    > tools.jar not found at your JAVA_HOME dir /Applications/IntelliJ IDEA <http://CE.app/Contents/jbr/Contents/Home|CE.app/Contents/jbr/Contents/Home>.
      Building with a JRE or JDK9 is currently not supported.
    s
    • 2
    • 1
  • r

    raulraja

    10/29/2019, 8:12 AM
    Free has the issue in Kotlin that interpreting multiple algebras is not fast as the number grows, we fixed that for Scala in Freestyle but Free + Coproduct doesn't make a lot of sense in Kotlin until we have true union types
    j
    • 2
    • 11
  • j

    Jannis

    10/29/2019, 4:45 PM
    To improve propCheck's output I wrote a small pretty-print library. It's nothing special yet, but the basics are there. It's pretty early work, but I don't think there are any other pretty print libraries for kotlin so if you need one give this a try, it's gonna improve fast the next few days. Internally in propCheck I have a parser that can read generic toString (especially data classes toString) output, diffs that and displays it using this. https://github.com/1Jajen1/kotlin-pretty
    • 1
    • 1
  • p

    pakoito

    10/29/2019, 5:18 PM
    is it a formatter for Kotlin?
    j
    • 2
    • 5
Powered by Linen
Title
p

pakoito

10/29/2019, 5:18 PM
is it a formatter for Kotlin?
j

Jannis

10/29/2019, 5:40 PM
a formatter for kotlin data classes (or even better generic show/toString output) is something I have already working an a wip branch on propcheck (plus diffing) and I'll add a repo with it later this week
p

pakoito

10/29/2019, 5:41 PM
gotcha, good idea
rename it to
kotlinfmt
to piss off people 😄
j

Jannis

10/29/2019, 5:42 PM
it includes a parser for toString output and then diffs the result and pretty prints the diff. The parser is implemented with parser combinators (which I ported from megaparsec).
❤️ 1
pretty printer is already misleading enough I think 😄
kotlinfmt
is just evil^^
😈 1
View count: 4