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

    Bob Glamm

    12/04/2019, 3:49 PM
    I wish i had linked one here not so long ago, but for the past month I have been buried under a mountain of work
    😘 1
    p
    • 2
    • 1
  • r

    ruiter

    12/04/2019, 4:24 PM
    Hey guys, this project seems to be really cool! https://github.com/JorgeCastilloPrz/ArrowAndroidSamples Are there any articles related to this type of project? I wanted to learn more about how to use this approach to develop Android apps.
    r
    j
    t
    • 4
    • 6
  • p

    pakoito

    12/04/2019, 9:57 PM
    it should be straightforward, just remove the final property from fields here: https://bit.ly/2LozIWO
    r
    • 2
    • 9
  • a

    adimit

    12/05/2019, 1:55 PM
    Hi. I've noticed that with functions returning
    Unit
    , monad comprehensions can lead to a somewhat confusing behaviour:
    g(): TUnit = TODO()
    f() = fx { g() }
    f0() = fx { g().bind() }
    Both
    f
    and
    f0
    return
    TUnit
    for any given
    T
    , but have different semantics. Is there any way, apart from introducing my own
    MyUnit
    object
    that I can guard against accidental omission of
    .bind()
    ?
    t
    • 2
    • 2
  • j

    jimn

    12/08/2019, 12:44 PM
    but i didnt see the gotchas section of Either casting documentation if there is one
    r
    • 2
    • 23
  • s

    simon.vergauwen

    12/09/2019, 3:39 PM
    There is
    EqK
    , no?
    ☝️🏼 1
    p
    j
    • 3
    • 3
  • j

    Johan Basson

    12/10/2019, 4:18 PM
    How would one implement publish subscribe / concurrency in a functional (arrow) way?
    s
    s
    +2
    • 5
    • 12
  • s

    sahil Lone

    12/12/2019, 12:21 PM
    Either.catch gives me result type , which I still need to map to the service type which is either which I cant change at this momement.
    r
    j
    • 3
    • 5
  • j

    james

    12/13/2019, 12:26 AM
    Has anyone written a Gson wrapper for Arrow types?
    s
    j
    • 3
    • 2
  • s

    simon.vergauwen

    12/13/2019, 1:12 PM
    And that was in an empty Kotlin project
    j
    • 2
    • 2
  • g

    gabib

    12/13/2019, 2:13 PM
    I already read it and it is my next option 😁
    p
    • 2
    • 3
  • j

    jimn

    12/13/2019, 4:20 PM
    type-graphs seem like the domain of haskell/arrow, though the java type-graph example i have sort of autocompletes automatically in intellij.
    r
    • 2
    • 5
  • j

    jimn

    12/13/2019, 5:40 PM
    this n*m seems to be the exact thing bartos milleiw (sp?) addresses in his very first lecture.
    r
    • 2
    • 73
  • b

    Bob Glamm

    12/13/2019, 8:48 PM
    ListK.parTraverse
    will give me some (default) concurrency, right?
    j
    • 2
    • 5
  • s

    Satyam Agarwal

    12/14/2019, 1:11 AM
    I am starting a new project in my company with arrow
    0.10.3
    and considering helios for JSON parsing. But it looks like helios is on old dependencies. Would arrow maintainers still recommend using it in production? functional way and benchmarks are really tempting.
    p
    • 2
    • 1
  • s

    sean

    12/14/2019, 1:22 AM
    I haven't kept up to date. what is the recommended way of doing a two response left error (non throwable), right result and using fx/comprehensions?
    s
    p
    • 3
    • 8
  • k

    kartoffelsup

    12/15/2019, 12:12 PM
    Hi, could someone please help me find the Arrow 'way' of doing Applicative:
    *>
    and
    <*
    ? -> https://hackage.haskell.org/package/base-4.12.0.0/docs/Prelude.html#v:-42--62- I'm trying to implement/follow

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

    in Arrow.
    👀 1
    j
    m
    j
    • 4
    • 141
  • m

    marc0der

    12/16/2019, 5:43 AM
    Hi all! I have a question about the new union types: will arrow completely do away with
    Option
    and
    Either
    in the future, or will they co-exist with unions?
    r
    k
    j
    • 4
    • 16
  • s

    Shady Selim

    12/16/2019, 6:39 AM
    Hi @here I will be heading a Kotlin summit in Egypt and am asking if you have Arrow resources or slides to share to introduce Arrow to the developers in MENA
    r
    • 2
    • 1
  • p

    pakoito

    12/16/2019, 9:35 AM
    I have published a Reference Guide for Arrow-fx 0.10 to get you started! It covers everything from the basics of wrapping suspend functions and parallelism, to advanced use cases like safe resource management and program structure 📝 https://twitter.com/pacoworks/status/1206507788043718657
    :arrow: 12
    👏 12
    s
    p
    +3
    • 6
    • 21
  • s

    Sagar Suri

    12/16/2019, 10:39 AM
    Hey everyone, I recently joined the kotlin slack group only to see how arrow is progressing and excited to build android apps with it. You guys are doing a great job 👏. I have few questions regarding arrow library: 1) I come from the OOP world but have a year of experience with Kotlin. How can I get started learning arrow step by step? 2) Are there any plans to make a public online training service? 3) When arrow will reach v1.0? Looking forward to using arrow and enjoy the benefits of it. ❤️ Thanks again.
    ❤️ 6
    💯 1
    :arrow: 6
    r
    j
    a
    • 4
    • 11
  • p

    pakoito

    12/16/2019, 2:24 PM
    @PPWasin ask away!
    p
    • 2
    • 26
  • r

    raulraja

    12/17/2019, 2:46 PM
    Threads please 😘
    🙈 2
    💯 4
    • 1
    • 1
  • d

    dnowak

    12/17/2019, 2:50 PM
    Hi, is there support for partial application of
    suspended
    functions? This does not compile:
    import arrow.syntax.function.invoke
    
    suspend fun add(one: Int, two: Int) = one + two
    
    suspend fun addOne(value: Int) = (::add)(p1 = 1)
    
    suspend fun addTwo(value: Int) = (::add).partially1(2)
    p
    r
    • 3
    • 9
  • j

    jimn

    12/17/2019, 3:00 PM
    e.g. elvis,if,when AST popups ... and sadly only a handful of others
    r
    • 2
    • 9
  • s

    Shmuel Rosansky [G]

    12/17/2019, 3:12 PM
    Hey there, question, what kind of API stability guarantees are there between ArrowKT versions? I noticed that the library is at v0.10.xx, is there an understanding that v1.0 can be breaking? Thanks!
    r
    • 2
    • 4
  • p

    pakoito

    12/18/2019, 2:19 AM
    so effect is a constructor, and ! is a way of executing it, an alias to
    bind
    s
    • 2
    • 1
  • m

    mattmoore

    12/18/2019, 3:44 AM
    @Sagar Suri Hi! I'm glad you asked that. Me and a few folks have been thinking about practical programming education with Arrow. I'm a CTO in Chicago who's very enthusiastic about FP and Arrow. We're starting up a new podcast and blog that will include discussions and tutorials on practical functional programming with Arrow. I'm also currently running a startup, and we are planning to implement Arrow in our product. We have decided to create a documentary about our startup, and how Arrow is helping us maintain sanity. In the interest of helping promote FP + Arrow, I wanted to reach out and see if anyone is interested in interviewing with us on our podcast. Remote discussions are an option, but we're also willing to travel to interview folks! We are hoping to help bring stronger awareness to FP and Arrow - benefits, challenges and how to design a functional system with Arrow. The podcast is launching early next year at http://lambda.show. If anyone's interested, please feel free to reach out to me! You can reach me here on kotlinlang or by email: mattmoore@lambda.show. My twitter handle is mattmoore_io. We're very friendly, and would be more than happy to speak with folks from any background who have a passion for FP with Arrow.
    🤘 2
    :yes: 3
    👍 2
    ❤️ 3
    💯 7
    :arrow: 7
    s
    r
    +2
    • 5
    • 12
  • a

    Attila Domokos

    12/18/2019, 11:21 PM
    Hello! I am looking for something like this in Kotlin Arrow. How can I accomplish the same with a list of
    Some
    values?
    j
    p
    r
    • 4
    • 52
  • j

    jimn

    12/19/2019, 10:30 AM
    just an fyi for FP: you can skate on c++ background for 3 decades in the jvm without any surprises but this is proof positive I'm not in the twilight zone with arrow.
    r
    • 2
    • 13
Powered by Linen
Title
j

jimn

12/19/2019, 10:30 AM
just an fyi for FP: you can skate on c++ background for 3 decades in the jvm without any surprises but this is proof positive I'm not in the twilight zone with arrow.
r

raulraja

12/19/2019, 11:46 AM
yep, here we always refer to the CT meaning of it. I think Bartosz post on CT for C++ may help you draw the anology between the two worlds and what you already know from C++ https://bartoszmilewski.com/2015/01/20/functors/
j

jimn

12/19/2019, 12:09 PM
i think the occasional signpost in the autodocs specifically to functor is going to help those of us who learned it from James Coplien's Purple book of c++ idioms which were dissimiilar concepts altogether but drove the entirety of the culture.
i have scratching my head for weeks or longer trying nail down the simplest possible analogs back to template metaprogramming and STL
there is no FP equivalent to the c++ iterator, but java streams and to some lesser degree iostreams do appear to fit monadic definition
without gc we would have been tossed out on our ear for favoring recursion or immutability in constrained programming situations
our closest relationship to FP was metaprogramming with macros and templates to eliminate the intermediary state entirely and avoid object creation.
r

raulraja

12/19/2019, 12:34 PM
right, in Kotlin instead of that you use generics or the kind emulation to achieve polymorphic functions and classes that are equivalent to those templates
but the allocation free runtime is only possible if your implementations use inline classes and cast to the correct states
otherwise is just standrd JVM dynamic interface dispatch as a penalty
so one function call away from the abstraction always
The alternative is to work with concrete types or model your entire program as an ADT that can be interpreted and optimized but allocations are still always there
Among other things because in Kotlin you can’t represent unions or products as structs without allocations
all ADTs and sealed hierarchies are penalized because they require allocation and generate garbage to clean up by GC
View count: 5