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

    raulraja

    04/24/2018, 7:43 PM
    @jtonic forgot also to mention:
    OptionT.monad<EitherKindPartial<String>>()  
    //is now
    OptionT.monad(Either.monad<String>())
    👍 1
    j
    • 2
    • 9
  • j

    jtonic

    04/25/2018, 8:30 PM
    Dear arrow community, Yesterday I was a presenter at a kotlin meetup event in Bucharest, Romania. And the topic was about how friendly is kotlin programming language to FP approach, and, moreover, how amazing is the kotlin
    FP companion library, Arrow
    . Preparing this event was not easy at all, considering I just started, the FP journey, more than a month ago. Needless to say that
    Functional Kotlin
    book was the main source of information, w/o it, I was definitely lost. Reading it was a pleasure, and it easy the FP path I am on. I want to congratulate the authors for their amazing work, and I am looking forward to reading some other books of them. On the other hand, there were moments I was really stuck with understanding some concepts or not figuring out why some arrow based test code refuse to compile. In these moments this channel was my salvation, and I witnessed how amazing the kotlin/arrow community is. *A big THANK YOU to each and every of you for how amazing you are.
    😭 1
    😒imple_smile: 1
    :arrow: 7
    ❤️ 8
    d
    r
    • 3
    • 2
  • d

    dh44t

    04/25/2018, 10:49 PM
    @jtonic thank you for your kind words, writing that book was hard as nails for both Rivu and me. But knowing that people find it enjoyable and useful leave me with a feeling of gratitude
    :arrow: 1
    ❤️ 1
    j
    • 2
    • 2
  • j

    Jeff Thomas

    04/30/2018, 9:12 PM
    hi folks, I am relatively new to Kotlin and very new to functional programming... as a learning exercise I am trying to convert a scala parser library to Kotlin and I was wondering if there is anyway to do this with Kotlin/Arrow: sealed trait FooBar[L <: HList, T <: HList, R <: HList] { type Out <: HList } object FooBar { implicit def foobar[L <: HList, T <: HList, R <: HList, Out0 <: HList] (implicit ts: Aux[L, L, T, T, R, HNil, Out0]): FooBar[L, T, R] { type Out = Out0 } = throw IllegalStateException("Compile-time only call") I am having trouble with the "type" parameter which is reassigned with the function "foobar" (ie. fb.Out can be assigned a different type)...
    r
    • 2
    • 3
  • s

    simon.vergauwen

    05/01/2018, 1:11 PM
    You can follow progress here https://github.com/arrow-kt/arrow/issues/808
    👍 3
    j
    • 2
    • 1
  • i

    isto

    05/05/2018, 4:27 PM
    well, I can try, I'm not very familiar with the arrow codebase yet nor all the new concepts that it introduces, but this seems like a good opportunity to start
    🍻 2
    :arrow: 2
    s
    • 2
    • 2
  • r

    raulraja

    05/12/2018, 4:43 PM
    @rawtoast https://github.com/RawToast/go-north-and-die/blob/master/src/main/kotlin/gonorth/free/GameEffect.kt awesome stuff! 👏
    🙀 1
    😍 2
    :arrow: 5
    r
    p
    • 3
    • 5
  • d

    dnowak

    05/22/2018, 2:27 PM
    I tried but cannot figure out what should be in place of … to make it work 🙂
    r
    • 2
    • 1
  • j

    jimn

    06/19/2018, 12:44 AM
    @xenomachina what is the parser target? narses is sort of a production system input format
    x
    • 2
    • 102
  • j

    jimn

    06/19/2018, 3:29 AM
    "i would expect any library throwing around the term FP and "purity" in the README elevator pitch would make some inroads toward safer type system and operators than the ones that make a dual type hierarchy for nulls and ternary by null/elvis", leveraging kotlin's almighty Unit and Nothing Monads
    p
    • 2
    • 2
  • r

    rudolf.hladik

    06/19/2018, 10:19 AM
    whats the difference between Either, Option, Validated? besides naming?
    d
    • 2
    • 1
  • p

    pakoito

    06/20/2018, 3:40 PM
    like the Combined instances IIRC
    s
    j
    • 3
    • 2
  • r

    raulraja

    06/21/2018, 11:26 PM
    https://twitter.com/raulraja/status/1009936953532407809?s=19
    :arrow: 1
    s
    • 2
    • 1
  • r

    raulraja

    06/22/2018, 8:00 AM
    @jacob no dates yet, I'm gonna focus on finishing the keep-87 and then move into those integrations. But if people need it soon we can discuss implementations and take it from there with whomever wants to help and it's available.
    👏 5
    g
    • 2
    • 13
  • j

    jacob

    06/27/2018, 5:17 AM
    does kotlin have the concept of forall in its type system?
  • e

    elizarov

    06/27/2018, 6:43 AM
    @jacob forall support in Kotlin type system is limited. Generic functions in Kotlin have forall type signature like
    fun <T> foo(a: T): List<T>
    (the type of
    foo
    in Haskell terms would be
    forall t. t -> List t
    ), but you cannot directly capture such a functional type in a plain variable. You’ll have to always capture both
    foo
    and
    T
    with another generic function like
    fun <T> bar(a: T) = foo(foo(a))
    or with a generic class like
    class A<T> { fun bar(a: T) = foo(a) }
    p
    j
    • 3
    • 4
  • e

    elizarov

    06/27/2018, 8:03 PM
    Not really. There is no generic way to know if the current thread already has event loop unless you are programming in some kind of a framework that guarantees that any thread has an event loop. Why do you care about threads anyway?
    g
    • 2
    • 2
  • p

    pakoito

    07/02/2018, 6:15 PM
    It’s not easy to know without a bit of context 😄
    j
    • 2
    • 14
  • p

    pakoito

    07/03/2018, 9:43 AM
    and I’m not sure whether you’ll get the right ::plus, so you may still need the lambda
    g
    • 2
    • 1
  • x

    xenomachina

    07/03/2018, 6:15 PM
    I was trying to do something like this:
    val foo = myEither.getOrElse { return false }
    but Kotlin won't allow this because the lambda to
    getOrElse
    is
    crossinline
    . Why is it declared
    crossinline
    ?
    a
    p
    • 3
    • 89
  • s

    simon.vergauwen

    07/03/2018, 6:30 PM
    @zmarkan we call it “Functional companion to Kotlin’s Standard Library” on www.arrow-kt.io so FP toolkit is the right terminology I think
    z
    • 2
    • 1
  • p

    pakoito

    07/03/2018, 11:18 PM
    if we don’t inline we can’t have local or non-local returns
    g
    r
    • 3
    • 5
  • p

    pakoito

    07/04/2018, 12:17 AM
    ask Simon lol
    s
    • 2
    • 1
  • j

    jacob

    07/04/2018, 12:27 AM
    I like Reason a lot
    r
    • 2
    • 1
  • v

    veiset

    07/16/2018, 10:40 AM
    Is there a way to flatten a Try?
    Try {
                when (accessChecker.loggedInUserHasAccess()) {
                    true -> Try.just(Unit)
                    false -> Try.raise(FeatureAccessDeniedException("No access for feature"))
                }
            }
    Or is better to just throw the error in the false branch. Note that
    accessChecker.loggedInUser...
    can also throw an exception.
    Try {
                when (accessChecker.loggedInUserHasAccess()) {
                    true -> Unit
                    false -> throw FeatureAccessDeniedException("No access for feature")
                }
            }
    t
    • 2
    • 3
  • j

    Jorge Castillo

    07/21/2018, 10:37 PM
    https://twitter.com/JorgeCastilloPr/status/1020693581701492736?s=19
    :arrow: 4
    t
    • 2
    • 2
  • p

    pakoito

    07/28/2018, 8:35 PM
    for non-maintainers, how’s this tutorial?
    👍 1
    v
    • 2
    • 3
  • p

    pakoito

    07/28/2018, 8:35 PM
    https://github.com/arrow-kt/arrow/blob/paco-docsafterhadi/modules/docs/arrow-docs/docs/docs/patterns/monads/README.md
    t
    • 2
    • 1
  • p

    pakoito

    08/08/2018, 10:17 PM
    if any one
    enrichValue
    fails, the whole operation fails. Else it aggregates the successes on the right, which you map to the update of your previous value.
    j
    • 2
    • 6
  • l

    Leandro Borges Ferreira

    08/16/2018, 12:19 AM
    Hi folks, I am trying to compile a project with arrow-recursion using
    ./gradlew clean build
    , but I am getting:
    Could not determine the dependencies of task ':jar'.
    > Could not resolve all files for configuration ':compile'.
       > Could not find io.arrow-kt:arrow-recursion:0.7.2.
         Searched in the following locations:
             <https://repo.maven.apache.org/maven2/io/arrow-kt/arrow-recursion/0.7.2/arrow-recursion-0.7.2.pom>
             <https://repo.maven.apache.org/maven2/io/arrow-kt/arrow-recursion/0.7.2/arrow-recursion-0.7.2.jar>
             <https://jcenter.bintray.com/io/arrow-kt/arrow-recursion/0.7.2/arrow-recursion-0.7.2.pom>
             <https://jcenter.bintray.com/io/arrow-kt/arrow-recursion/0.7.2/arrow-recursion-0.7.2.jar>
         Required by:
             project :
    Should I add some location in my gradle project?
    a
    • 2
    • 2
Powered by Linen
Title
l

Leandro Borges Ferreira

08/16/2018, 12:19 AM
Hi folks, I am trying to compile a project with arrow-recursion using
./gradlew clean build
, but I am getting:
Could not determine the dependencies of task ':jar'.
> Could not resolve all files for configuration ':compile'.
   > Could not find io.arrow-kt:arrow-recursion:0.7.2.
     Searched in the following locations:
         <https://repo.maven.apache.org/maven2/io/arrow-kt/arrow-recursion/0.7.2/arrow-recursion-0.7.2.pom>
         <https://repo.maven.apache.org/maven2/io/arrow-kt/arrow-recursion/0.7.2/arrow-recursion-0.7.2.jar>
         <https://jcenter.bintray.com/io/arrow-kt/arrow-recursion/0.7.2/arrow-recursion-0.7.2.pom>
         <https://jcenter.bintray.com/io/arrow-kt/arrow-recursion/0.7.2/arrow-recursion-0.7.2.jar>
     Required by:
         project :
Should I add some location in my gradle project?
a

Alisson Morais

08/16/2018, 1:45 AM
Hey Leandro, there's a open issue that talking about it. Take a look at https://github.com/arrow-kt/arrow/issues/891 Hope that helps 🙂
👍🏼 2
l

Leandro Borges Ferreira

08/16/2018, 12:35 PM
Thanks Alisson!
View count: 3