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

    pakoito

    03/01/2019, 10:16 PM
    yeah, you can put it here! https://github.com/arrow-kt/arrow/tree/master/modules/docs/arrow-examples/src/test/kotlin/arrow
    i
    • 2
    • 1
  • p

    pakoito

    03/01/2019, 10:18 PM
    -.dart
    i
    r
    • 3
    • 7
  • t

    tomasruizlopez

    03/08/2019, 12:04 PM
    In case you can take advantage of our implementation of Selective Applicative Functors in Swift with Bow: https://www.staff.ncl.ac.uk/andrey.mokhov/selective-functors.pdf
    👍 1
    p
    r
    • 3
    • 6
  • s

    stojan

    03/08/2019, 4:57 PM
    so I guess kotlintest started using
    toString
    ?
    s
    • 2
    • 2
  • r

    raulraja

    03/09/2019, 1:23 PM
    if you don't want to bring the arrow-core types we can take
    Kind
    to a minimal module
    arrow-kinds
    p
    • 2
    • 1
  • p

    pakoito

    03/10/2019, 3:57 AM
    https://github.com/arrow-kt/arrow/issues/1347
    k
    • 2
    • 5
  • p

    pakoito

    03/10/2019, 12:42 PM
    can you explain it a bit? 😄
    j
    r
    i
    • 4
    • 24
  • s

    simon.vergauwen

    03/16/2019, 1:33 PM
    Anyway IIRC there used to be support for kapt in
    kotlinc
    but they removed or deprecated it.
    j
    • 2
    • 2
  • s

    simon.vergauwen

    03/16/2019, 1:33 PM
    Did you have any idea of how to tackle this? Because we'd need multiple processing rounds, no?
    r
    • 2
    • 1
  • i

    Imran/Malic

    03/17/2019, 12:18 PM
    what does this do in ank: kotlin:ank:replace
    r
    • 2
    • 12
  • r

    raulraja

    03/17/2019, 8:33 PM
    @Alisson Morais I reviewed https://github.com/arrow-kt/arrow/pull/1332 and it all looks great except mapFilter on IO
    a
    • 2
    • 4
  • r

    raulraja

    03/20/2019, 9:29 PM
    @higherkind data class ListK<A>(val list: List<A>): ListKOf<A>
    
    // Generates the following code:
    //
    // class ForListK private constructor() { companion object {} }
    // typealias ListKOf<A> = Kind<ForListK, A>
    // fun ListKOf<A>.fix() = this as ListK<A>
    • 1
    • 1
  • s

    sam

    03/20/2019, 9:30 PM
    Yeah one of the other arrow guys explained it to me but it was in one ear out the other
    r
    • 2
    • 1
  • s

    sam

    03/20/2019, 9:31 PM
    I need to learn things 3 times before it sticks in my head. That's the problem with being an old man
    r
    e
    • 3
    • 5
  • r

    raulraja

    03/20/2019, 9:43 PM
    yeah, just comment
    @extension
    but shouldn't the arrow module be
    jvm
    only since arrow is only published in the JVM for now?
    s
    • 2
    • 1
  • r

    raulraja

    03/21/2019, 1:05 AM
    but if you can avoid it I find working with type classes safer and more constrained
    s
    • 2
    • 4
  • p

    pakoito

    03/22/2019, 12:44 PM
    who's organising that I can ask questions to?
    a
    • 2
    • 2
  • i

    Imran/Malic

    03/23/2019, 8:48 AM
    or should I use this one https://github.com/1Jajen1/propCheck
    j
    • 2
    • 1
  • p

    pakoito

    03/26/2019, 5:33 PM
    this is a good starter ticket I believe: https://github.com/arrow-kt/arrow/issues/1357
    i
    • 2
    • 8
  • p

    pakoito

    03/26/2019, 10:47 PM
    I’ve just realised from twitter that @Adi Polak wanted a ticket from the book 😄 1.8 should be the best choice: https://github.com/arrow-kt/Category-Theory-for-Programmers.kt/issues/10
    a
    • 2
    • 2
  • a

    aballano

    04/01/2019, 4:48 PM
    hi there, I'm trying to add arrow to an example android app. I'm wondering, is it possible, having an
    IO<Either<E, A>>
    to flatmap to another one in case the inner Either is
    left
    ? I managed to do this, but I believe the same IO is being executed twice in case of the either is
    right
    fun <E, A> IO<Either<E, A>>.handleErrorWith(f: (E) -> IO<Either<E, A>>): IO<Either<E, A>> {
        return flatMap { either ->
            either.fold(ifLeft = {
                f(it)
            }, ifRight = { this })
        }
    }
    p
    • 2
    • 2
  • a

    aballano

    04/01/2019, 4:52 PM
    I know there's gonna be
    BIO<E, A>
    exactly for this, but I happen to have this week for now to try it out 😄 Although if there's anything I can do on the PR to help... cc @pakoito
    p
    r
    s
    • 4
    • 7
  • a

    aballano

    04/03/2019, 9:34 AM
    I'm not sure if I'm doing something wrong or there's something fishy when trying to run code on Android's main thread:
    // Android's fragment code
    override fun onResume() {
        super.onResume()
        unsafe {
            runBlocking {
                fx {
                    println("DEBUG onResume 0 $threadName")
                    continueOn(NonBlocking)
                    println("DEBUG onResume 1 $threadName")
                    continueOn(Dispatchers.Default)
                    println("DEBUG onResume 2 $threadName")
                    continueOn(Dispatchers.Main)
                    println("DEBUG onResume main $threadName")
                }
            }
        }
    }
    output is:
    DEBUG onResume 0 main
    DEBUG onResume 1 ForkJoinPool-1-worker-2
    DEBUG onResume 2 DefaultDispatcher-worker-2
    g
    p
    s
    • 4
    • 24
  • r

    raulraja

    04/05/2019, 11:57 AM
    what would the syntax look like?
    a
    • 2
    • 9
  • p

    pakoito

    04/05/2019, 12:31 PM
    doing it blocking is trivial, but if you reentrantly call into the main thread, as you saw with runBlocking, it never completes
    a
    • 2
    • 17
  • r

    raulraja

    04/10/2019, 8:18 AM
    We are gonna get rid of kapt before 1.0 during this year but not sure it helps your problem now
    g
    • 2
    • 8
  • r

    raulraja

    04/10/2019, 1:34 PM
    I think @sam decided to leave it but we can try making any changes n arrow that accommodates this issue
    s
    • 2
    • 1
  • p

    pakoito

    04/15/2019, 8:29 AM
    You’re right, they’re missing.
    <|>
    is not there because we don’t have/use operator, that’s an easy one 😄 We could accept a PR for a function version of it and
    many
    .
    j
    • 2
    • 7
  • i

    Imran/Malic

    04/18/2019, 8:05 AM
    Hey, guys I created an [Arrow-Docset](https://github.com/i-walker/Arrow-Docset) for Dash. I appreciate contributions and supervisors :arrow:💪🏽
    🎉 4
    :arrow: 2
    m
    • 2
    • 1
  • a

    Ariostonj

    04/24/2019, 1:34 AM
    Hi, I am trying to make a Free Monoid of a list using Arrows, but I have some doubts. When I read about Free, I always see Initial in the context (maybe my reading is biased) I also read [this](https://kotlinlang.slack.com/archives/C5UPMM0A0/p1554022508033000), I assume that for to write a Free Monoid I must create two class a "Mempty" and a "Mappend" and I should provide an Interpreter (is this right ?). But for me, it does not look like [this](https://github.com/hmemcpy/milewski-ctfp-pdf/blob/master/src/content/2.3/code/scala/snippet02.scala). Someone can point to me the right direction to do that with using Arrow's (free)[https://github.com/arrow-kt/arrow/blob/master/modules/free/arrow-free-data/src/main/kotlin/arrow/free/Free.kt]. Tks for any help and sorry for any trouble;
    r
    • 2
    • 2
Powered by Linen
Title
a

Ariostonj

04/24/2019, 1:34 AM
Hi, I am trying to make a Free Monoid of a list using Arrows, but I have some doubts. When I read about Free, I always see Initial in the context (maybe my reading is biased) I also read [this](https://kotlinlang.slack.com/archives/C5UPMM0A0/p1554022508033000), I assume that for to write a Free Monoid I must create two class a "Mempty" and a "Mappend" and I should provide an Interpreter (is this right ?). But for me, it does not look like [this](https://github.com/hmemcpy/milewski-ctfp-pdf/blob/master/src/content/2.3/code/scala/snippet02.scala). Someone can point to me the right direction to do that with using Arrow's (free)[https://github.com/arrow-kt/arrow/blob/master/modules/free/arrow-free-data/src/main/kotlin/arrow/free/Free.kt]. Tks for any help and sorry for any trouble;
r

raulraja

04/24/2019, 9:38 AM
A Free monoid can be encoded with just a List of terms and the Monoid for their contained item. This is an example in Scala that could be easily ported to Kotlin https://github.com/typelevel/spire/blob/master/core/src/main/scala/spire/algebra/free/FreeMonoid.scala
👍 1
run
just iterates over the list applying a transformation and combining all internal values with the Monoid of the elements
View count: 10