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

    Leandro Borges Ferreira

    11/08/2018, 9:57 PM
    I looks very good =). You could work with Kind instead of IO and concretize it only in the main method, if you feel like keep playing with it.
    🔝 3
    s
    • 2
    • 3
  • r

    raulraja

    11/12/2018, 9:45 PM
    would be great to have it in the examples
    s
    p
    • 3
    • 9
  • h

    Hexa

    11/13/2018, 8:16 AM
    How to fix this error when building the kotlin arrow project? Does kotlin arrow requires Java 10?
    org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':arrow-annotations-processor'.
        at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:79)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:73)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.access$400(LifecycleProjectEvaluator.java:54)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:107)
        
    Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':arrow-annotations-processor'.
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:92)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:206)
        at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
    
    Caused by: org.gradle.api.GradleException: tools.jar not found at your JAVA_HOME dir /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home.
    Building with a JRE or JDK9 is currently not supported.
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    g
    p
    • 3
    • 10
  • s

    stojan

    11/17/2018, 7:59 PM
    @Leandro Borges Ferreira suggested I could play more with the Hangman and abstract over the container. Here is the result: https://gist.github.com/LordRaydenMK/0be8f70f860a862e69daf262b4a83e17 is
    Async
    the right typeclass? Do you see anything I could do better?
    l
    • 2
    • 2
  • p

    pakoito

    11/17/2018, 8:00 PM
    there are no treads, and you can do some error handling that async doesn’t 😄
    s
    • 2
    • 1
  • r

    raulraja

    11/17/2018, 9:28 PM
    really we need
    delay
    in monad defer which is the same as invoke
    s
    • 2
    • 2
  • t

    tmg

    11/21/2018, 2:17 PM
    composing the functions?
    t
    • 2
    • 1
  • r

    raulraja

    11/21/2018, 2:38 PM
    @tginiotis do you have a sample code with types that illustrates the problem?
    t
    • 2
    • 3
  • t

    tmg

    11/21/2018, 2:45 PM
    so you actually need a product?
    t
    • 2
    • 1
  • r

    raulraja

    11/21/2018, 2:56 PM
    val result: Map<String, List<String>> = listOf("one", "two", "three").groupBy { 
      if (it.contains("n")) "nCount"
      else if (it.contains("x")) "xCount"
      else "others"
    }
    t
    • 2
    • 1
  • l

    Leandro Borges Ferreira

    11/21/2018, 8:57 PM
    Some problem with ANK
    r
    d
    • 3
    • 4
  • p

    pakoito

    11/27/2018, 7:05 PM
    you can do it multiple ways, with
    Subject
    , with
    Observable.create
    , and with
    ObservableK.async
    . The first one is more imperative (read easier) and doesn't have coordinated cancellation or cleanup. If you want to close the websocket when there's a failure, use
    Observable.create
    .
    ObservableK.async
    will get support for that too soon, thanks to @simon.vergauwen and @Jorge Castillo
    👍🏻 2
    k
    • 2
    • 1
  • p

    pakoito

    11/28/2018, 2:05 PM
    -.js
    p
    • 2
    • 11
  • p

    pakoito

    11/29/2018, 10:52 AM
    post it on twitter, I’ll help promoing it 😄
    j
    m
    • 3
    • 3
  • s

    simon.vergauwen

    12/03/2018, 2:18 PM
    You should be able to find it in
    arrow-core-instances
    t
    p
    r
    • 4
    • 13
  • j

    jacob

    12/05/2018, 12:25 PM
    I can't believe how good the docs are getting. who do we have to thank?
    r
    • 2
    • 1
  • p

    pakoito

    12/05/2018, 10:55 PM
    @Mike it’s exactly like the match between your function and filterOrElse 😄
    m
    • 2
    • 2
  • r

    raulraja

    12/08/2018, 1:21 AM
    @Mike not sure about windows but if it's code related you can just use
    test
    locally and when you send the PR it will try the full build on travis and run detekt
    m
    • 2
    • 6
  • m

    Miguel Coleto

    12/08/2018, 12:19 PM
    You can do
    assemble
    instead of build for avoiding detekt
    m
    p
    • 3
    • 4
  • r

    raulraja

    12/10/2018, 1:22 PM
    @AdrianRaFo in my experience while it's nice writing the build files in Kotlin it's sometimes hard to integrate new stuff since most plugins offer examples and documentation around the groovy style scripts for gradle. In my opinion it's not worth the effort and we have many other areas where help would cause a bigger impact.
    👍 5
    m
    j
    • 3
    • 2
  • s

    Saša Šijak

    12/14/2018, 2:12 PM
    I saw this link in arrow github project https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/ Is it worth it to go through this "course"? Are topics well explained? Which languages he use for the examples?
    n
    p
    • 3
    • 5
  • p

    pakoito

    12/25/2018, 10:11 PM
    we’re phasing out invoke in favor of delay
    ➕ 1
    s
    s
    • 3
    • 4
  • p

    pakoito

    12/25/2018, 10:18 PM
    everything else looks great to me
    s
    • 2
    • 1
  • s

    streetsofboston

    12/26/2018, 9:57 PM
    Maybe what @rrader is looking for is a new type that can model `Undefined`/`Defined` (instead of
    Optional
    or
    Nullable
    ).
    val columnValue : Defined<Option<String>>
    or
    val columnValue: Defined<String?>
    Overloading the
    Optional
    (
    Option
    ) or
    Nullable
    with ‘(un)defined’ is not a good idea, in my opinion. Don’t mix them 😉
    r
    • 2
    • 1
  • e

    Egor Trutenko

    12/26/2018, 10:12 PM
    Also, Kotlin Serialization is the only serialization library so far (or of which I'm aware) that has
    @Optional
    annotation, so it helps a little
    g
    • 2
    • 1
  • e

    Egor Trutenko

    12/26/2018, 10:17 PM
    It's just that both optionality and nullability are things
    g
    • 2
    • 1
  • a

    acando86

    12/27/2018, 9:40 AM
    My two cents. I tend to agree me too that it's bad design.
    null
    should not be used as a valid value IMO (not in the api response, not in json, not in code). null doesn't convey lot of information. if null is used to express something, chances are there are more explicit ways to encode that information semantically and in a more type-safe way (if option alone is not enough to express all the possible scenarios), instead of appending a meaning to the null value (for instance, ADTs etc). Close to the DB layer (in the code) it might make sense to store raw null values, but in between a db and the api response i would expect a number of mapping layers and business logic where relying on a specific meaning of null values is not necessary and maybe (IMO) not even advisable.
    r
    t
    p
    • 4
    • 71
  • v

    veiset

    01/03/2019, 1:56 PM
    Oh! So you would basically use it to delay the side effects until you're at the end of the world?
    n
    • 2
    • 1
  • r

    raulraja

    01/03/2019, 9:07 PM
    The point in which an entire abstract program defined in terms of kinds and type classes is made concrete to IO which usually happens in main or wherever you are given control in your framework of choice. If that doesn't make sense I can provide code examples in a sec
    n
    • 2
    • 10
  • b

    bjonnh

    01/06/2019, 5:59 PM
    https://gist.github.com/bjonnh/e7358781df1137da59fec6f37d0ee163
    r
    • 2
    • 15
Powered by Linen
Title
b

bjonnh

01/06/2019, 5:59 PM
https://gist.github.com/bjonnh/e7358781df1137da59fec6f37d0ee163
r

raulraja

01/06/2019, 6:02 PM
seems to be missing the error types
it does not compile
b

bjonnh

01/06/2019, 6:04 PM
my bad I had a file with the same package
that should do it now
👍 1
I did see things about bindIn
(updated object to class so I can have a main)
I hope you can see what I tried to do
r

raulraja

01/06/2019, 7:17 PM
https://gist.github.com/raulraja/44b34ca2b72f9047318194227380a81d
👍 2
we are fixing now the method I mentioned
toIO
that is currently missbehaving
b

bjonnh

01/06/2019, 7:56 PM
thanks!
not really an arrow question, but I was wondering about the (thread) safety of my handling of the datetime. As this function is ultimately called by the user in the GUI (through TornadoFX events).
so this is going to appear on github your correction for toIO? I am using the latest github version in my project there were a lot of things missing in 0.8.2
Your solution works perfectly thanks a lot!
r

raulraja

01/06/2019, 9:45 PM
no problem, the fix for toIO will come up in .9.0 in a couple of weeks
will keep the channel posted
➕ 1
View count: 6