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

    streetsofboston

    07/29/2019, 2:28 PM
    😆 “Functional Programming? Don’t Even Bother, It’s a Silly Toy” by Ilya Suzdalnitski https://link.medium.com/w2SxRoWEIY
    🙂 1
    d
    s
    • 3
    • 3
  • s

    Satyam Agarwal

    07/29/2019, 4:30 PM
    Hey guys. I am here again with another gist of around 50 lines, and along with it 7 questions. Again I am really sorry I am doing like this, but I thought 1. I don’t want to spam the channel, and 2. Gist can found easily than scrolling slack conversation. I have tried `fx`’s
    parTraverse
    and it works after spending my whole Sunday to make it work, but I can’t grasp why it works. Thus the questions. Can you help me understand it please. Here is the gist : https://gist.github.com/satyamagarwal/336f02954fa4dc369fdea6524f593d1a
    👍 3
    s
    p
    • 3
    • 30
  • s

    sam

    07/29/2019, 8:51 PM
    What about if you wanted an Either for something that isn’t really suspendable, like say parsing a string to an int? In that case Either.catch wouldn’t work ?
    p
    r
    d
    • 4
    • 216
  • b

    Bob Glamm

    07/30/2019, 2:18 AM
    fun <F> IO<F>.runner(connection: Connection): JDBCOps<F> =
            object: JDBCOps<F>, Fx<F> by this, Bracket<F, Throwable> by this {
    doesn't work because Fx<F> is not Bracket
    s
    • 2
    • 16
  • p

    pakoito

    07/30/2019, 5:29 PM
    it's supposed to be there
    p
    • 2
    • 1
  • p

    PhBastiani

    07/31/2019, 3:25 PM
    What do you mean by
    Free.monad()
    Today, i tried to translate de Scala Cats sample into Kotlin (see https://gist.github.com/PBastiani/3598c838cbfdd982238360244b7550ed) Something seems wrong in the interpreter : i understand that in my FREE program
    FreeKVStore<Unit>
    is in conflict with
    Kind<F, A>
    ! But, I don't know how to fix that...
    r
    • 2
    • 19
  • c

    carbaj0

    08/01/2019, 10:21 AM
    hello, i have this issue when try to generate an app Android
    s
    • 2
    • 2
  • b

    Bob Glamm

    08/01/2019, 2:30 PM
    Yeah, there is a diagram for each type, but I'm talking an integrated diagram like https://github.com/tpolecat/cats-infographic that shows everything on one page
    p
    • 2
    • 2
  • r

    Ryan Benasutti

    08/04/2019, 4:03 AM
    Is there something similar to
    IO.handleError { }
    that doesn't require I provide an
    IO<A>
    (perhaps one which requires an
    IO<Unit>
    )? I have a method which returns an
    IO<A>
    , but I need to guarantee certain additional IO operations happen if the former IO fails (and in this case, I can't return an
    IO<A>
    because that part failed).
    r
    s
    • 3
    • 20
  • b

    Bob Glamm

    08/05/2019, 12:55 PM
    ok, in the applicative case I can see that working, but if I have (say)
    val (r1) = query("...", mapper1); val r2 = computation(r1); val (r3) = update("...");
    then I'm back to monads and trying to run suspend blocks outside of coroutine scope if I don't have
    fx
    nested inside
    transaction
    p
    • 2
    • 1
  • r

    rcd27

    08/06/2019, 9:37 AM
    Need some help with
    MapK.traverse(..)
    method. Any code of how to use it?
    i
    • 2
    • 28
  • p

    Pagoda 5b

    08/06/2019, 12:02 PM
    Hi and hello, did anyone has issues with using concurrent.fx notation on kotlin 1.3.41, with the code generation error during compilation phase?
    compiler-error
    p
    • 2
    • 3
  • p

    pakoito

    08/06/2019, 1:27 PM
    @Bob Glamm see if this helps: https://arrow-kt.io/docs/patterns/dependency_injection/#disambiguating-colliding-instances
    b
    • 2
    • 8
  • s

    simon.vergauwen

    08/06/2019, 7:07 PM
    Personally I almost always prefer
    followedBy
    over
    flatMap { _ ->
    or
    bind
    .
    😲 1
    k
    • 2
    • 11
  • s

    Satyam Agarwal

    08/06/2019, 7:20 PM
    Also, most web apps today brings side effects from the very bottom. Like repositories (http call or db call), so most of the functions would have returning type as IO<A>. That being said, do I gain anything except for
    direct imperative syntax
    (which i am not leveraging here) from a function with returning type IO if I execute my IOs in fx ?
    for example :
    import <http://arrow.fx.IO|arrow.fx.IO>
    import arrow.fx.extensions.fx
    
    fun someFun(): IO<Unit> = IO { println("hey") }
    fun anotherFun(): IO<Unit> = IO { println("hey again") }
    
    fun main() {
        someFun().followedBy(anotherFun()).unsafeRunSync()
    }
    
    fun mainMain() {
        IO
            .fx {
               someFun().followedBy(anotherFun()).bind()
            }
            .unsafeRunSync()
    
    }
    
    main()
    mainMain()
    p
    • 2
    • 8
  • p

    pakoito

    08/06/2019, 8:19 PM
    many things are semigroupal: numbers, collections, strings, functions, even rx.Observable is semigroupal
    r
    i
    • 3
    • 7
  • b

    Bob Glamm

    08/07/2019, 1:21 PM
    awesome, I now have a little library that lets me express database transactions under fully polymorphic effects as follows:
    fun <A> service(): Kind<F, A> = transaction {
        val (r1) = query(QUERY1, query1Mapper)
        val (r2) = query(QUERY2, query2Mapper)
        combine(r1, r2)
    }
    Now to add things like better update/insert support and eliminate some ugly refs to
    fx.monadThrow
    within the mappers. Could not have done this without your help. Thanks!
    ❤️ 4
    s
    r
    • 3
    • 4
  • c

    carbaj0

    08/09/2019, 6:24 AM
    message has been deleted
    p
    • 2
    • 1
  • n

    noiano

    08/09/2019, 8:15 AM
    so I guess there’s no way I go from
    (List<Try<A>>) -> List<A>
    with a simple flatmap
    s
    h
    • 3
    • 6
  • r

    Robert Menke

    08/10/2019, 8:13 PM
    Has
    OptionT
    (or any of the
    MonadT
    ) constructors been moved/replaced in the 0.10.0-snapshot? Can’t seem to figure out how to import/install them.
    s
    • 2
    • 2
  • r

    Robert Menke

    08/11/2019, 1:22 AM
    Gotcha that makes sense @pakoito thanks for the explanation. 🤞 for KEEP87 😉.
    r
    t
    k
    • 4
    • 8
  • t

    thanh

    08/11/2019, 5:23 PM
    Anyone acknowledge any library that supports those convenient functions for using Arrow data types with RxJava like this one?:
    fun <T, R> Observable<Either<Throwable, T>>.flatMapEither(mapper: (T) -> Observable<R>): Observable<Either<Throwable, R>> {
        return flatMap {
            when (it) {
                is Either.Right -> mapper(it.b).map { it.right() as BeckonResult<R> }
                is Either.Left -> Observable.just(it)
            }
        }
    }
    i
    p
    • 3
    • 6
  • t

    thanh

    08/11/2019, 5:42 PM
    it is just a bit complicated to introduce to our code base now 😞 We are even not very comfortable with concept of Traversable.
    r
    • 2
    • 1
  • r

    Ryan Benasutti

    08/11/2019, 7:18 PM
    Using
    ListK.applicative()
    and
    tupled(listA.k(), listB.k()
    , I can generate all `Tuple2`'s with the elements in both lists. If I give more arguments to
    tupled
    , then I get a
    Tuple3
    , etc. Is there a way to give more arguments to a method like
    tupled
    but still only get a
    Tuple2
    out? I want to get all the pairs of elements between n lists.
    r
    • 2
    • 5
  • b

    Bob Glamm

    08/11/2019, 7:44 PM
    Comments/suggestions/PRs/etc. welcome
    r
    • 2
    • 42
  • s

    stojan

    08/12/2019, 6:15 AM
    just wanna say amazing work with Ank ♥️
    🎉 8
    r
    r
    +2
    • 5
    • 13
  • d

    Derek Berner

    08/12/2019, 9:51 PM
    My problem is the opposite - I've had a good handle on this stuff for maaaaaaybe a few months, and now I can't unsee it, and I keep getting told to not use these abstractions because they're confusing the junior devs 😂
    😂 1
    p
    r
    k
    • 4
    • 3
  • a

    aeruhxi

    08/13/2019, 7:21 AM
    fun <K, V, R> Map<out K, V>.map(
        transform: (Entry<K, V>) -> R
    ): List<R>
    Why does
    map
    for
    Map
    in stdlib return
    List
    instead of
    Map
    ?
    i
    r
    +2
    • 5
    • 45
  • b

    Bob Glamm

    08/13/2019, 2:05 PM
    University of Minnesota - Twin Cities. EE major, so I am an expert in how to short out power supplies to spectacular effect.
    😂 2
    d
    • 2
    • 4
  • b

    Bob Glamm

    08/13/2019, 2:06 PM
    you?
    s
    • 2
    • 2
Powered by Linen
Title
b

Bob Glamm

08/13/2019, 2:06 PM
you?
s

simon.vergauwen

08/13/2019, 2:13 PM
University of Leuven, Belgium. No FP at all 😄
Not even mentioned
View count: 1