Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 13:02
    1Jajen1 commented #1926
  • 12:20
    AntonioMateoGomez labeled #1934
  • 12:05
    nomisRev commented #1932
  • 12:00
    1Jajen1 commented #1932
  • 11:45
    calvellido commented #1932
  • 11:29
    calvellido commented #1932
  • 11:19
    pakoito commented #1842
  • 10:33
    rachelcarmena commented #1932
  • 09:56
    abelkov commented #1932
  • 09:51
    AntonioMateoGomez synchronize #1934
  • 09:51

    AntonioMateoGomez on paolo-1923-github-stars

    Remove unused css variable (compare)

  • 09:47
    nomisRev labeled #1935
  • 09:47
    nomisRev opened #1935
  • 09:37
    AntonioMateoGomez synchronize #1934
  • 09:37

    AntonioMateoGomez on paolo-1923-github-stars

    Make bigger in home the open na… (compare)

  • 09:33
    AntonioMateoGomez edited #1934
  • 09:23
    nomisRev assigned #1807
  • 09:23
    nomisRev closed #1824
  • 09:23
    nomisRev closed #1825
  • 09:23
    nomisRev closed #1826
Marco Vermeulen
@marc0der
And if you wait until buying it tomorrow, Manning will give you a big 50% discount.
Ming
@noiter
@pakoito on page https://arrow-kt.io/docs/patterns/monads/#monad-laws, when explaining the Associativity law, in the code snippet you would see -> val g: (T) -> Kind<F, V>
Paco
@pakoito
@noiter fixed: arrow-kt/arrow@0af0fb2

@SAGARSURI Marco's book is a potential good start, the equivalent in Scala was very popular.

From us, start here: https://arrow-kt.io/docs/patterns/error_handling/

the thing about FP is that it's not a framework nor an architecure, rather a set of practices such as immutability and purity. Once you start applying those to your code, you start seeing pain points.
and the library addresses those common patterns and pain points
i.e. branching with Either, threading with IO, injection with Reader
you cannot take it all in one go, nor we can teach "FP architecture" on day one
start simple, do immutability everywhere and make any side-effect into a suspend function
see what your paint points are, find the consruct for them
Marco Vermeulen
@marc0der
Couldn't have said it better @pakoito
Paco
@pakoito

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://www.pacoworks.com/2019/12/15/kotlin-coroutines-with-arrow-fx/

Julius Marozas
@jul1u5
Hi, what does the exclamation mark mean in this example: !Observable.interval(100, TimeUnit.MILLISECONDS)? From Observable comprehensions third code block
Bob Glamm
@glammr1
roughly speaking, ! means "do this thing for its effect"
part of the fx syntax
Otherwise Observable.interval(100, TimeUnit.MILLISECONDS).k() is likely just an object wrapping a method reference
Julius Marozas
@jul1u5
So is ! just a function? How is it implemented?
Bob Glamm
@glammr1
I think it is the not extfun but I cannot remember on which interface/typeclass it is defined on
If you load the snippet up in IntelliJ and control/command-click then IntelliJ will display the definition
it is using one of Kotlin's limited operator overloads
Julius Marozas
@jul1u5
Ok, thanks!
Philippe Bastiani
@PhBastiani
@SAGARSURI the book 'The Joy of Kotlin' is also a good start to learn the FP principles.
Benjamin Krenn
@fridayy

hi, I hope this is the right channel to report this. While reading the docs I stumbled across a small mistake:
Error propagation in comprehensions

Both code listings contain the same code

Paco
@pakoito
thanks! I'll put a ticket
Raúl Raja Martínez
@raulraja
@jul1u5 ! Is the equivalent suspended imperative version of flatMap
It's going to be replaced for 'by'
a by fa
So you'd have to name each bind and we'll track it to give you an IO trace that is meaningful even when in concurrency or async contexts
! Is define in BindSyntax, an interface all fx blocks have access to
The current implementation is based on suspension and reflection which ties us to the JVM but the upcoming meta impl based on by rewrites bindings to flatMap and discovers flatMap structurally based on the member or extension scope of any given data type
This will unlock comprehensions automatically for all data types in the Kotlin and java ecosystem that have a valid flatMap shape by member or extension
Streams, Completable future, Rx, reactor, coroutinesx Flow etc.
Mochamad Iqbal Dwi Cahyo
@mochadwi

https://www.youtube.com/watch?v=qI1ctQ0293o this content is obsolete.

does the recommended ways for error handling, async handling (io), side-effect

using this from arrow-kt: https://arrow-kt.io/docs/patterns/error_handling/?

Bob Glamm
@glammr1
Long-term it's Either.catch() or Bifunctor IO
for error handling
async and the rest of the effects are spot-on, though
suggest joining #arrow in the kotlinlang slack (kotlinlang.slack.com)
Mochamad Iqbal Dwi Cahyo
@mochadwi
thanks for your response, will move this disscussion to kotlinlang.slack.com
Johann Maquin
@Jmaquin
Hello, I would like to create a State<List<Int>, Int> using the just function, however as per the signature (StateT : fun <F, S, T> just(AF: Applicative<F>, t: T): StateT<F, S, T>) I need an applicative , where can I get the applicative for List<T>? thanks
Bob Glamm
@glammr1
use ListK instead of List then use ListK.applicative()
also suggest joining #arrow in the kotlinlang slack (kotlinlang.slack.com)
Johann Maquin
@Jmaquin
thanks for your response
Gopal S Akshintala
@overfullstack
Does this section of kotlin arrow documentation has any typos? (coz when I try to copy paste the same code and compile it doesn’t work): https://arrow-kt.io/docs/patterns/error_handling/#monaderror
I see arm(ME: MonadError<F, NukeException>) and aim(ME: MonadError<F, NukeException>) are taking input params, but the subsequent code
fun <F> MonadError<F, NukeException>.attack():Kind<F, Impacted> =
fx.monad {
val (nuke) = arm<F>()
val (target) = aim<F>()
val (impact) = launch<F>(target, nuke)
impact
}
fun <F> MonadError<F, NukeException>.attack1(ME): Kind<F, Impacted> = ME.tupled(aim(), arm()).flatMap(ME, { (nuke, target) -> launch<F>(nuke, target) })
These functions are called without any arguments, same for attack() function. Am I missing anything?
Paco
@pakoito
you're right
it should be this as an argument, or the functions to be extfuns instead
Danny Kruitbosch
@dannykruitbosch
Hi, I'm trying to use Arrow in a java 11 module (JPMS) based app. When compiling I get this error java.lang.module.ResolutionException: Modules arrow.core.data and arrow.annotations export package arrow to module kotlin.stdlib.common. Does anyone know how to resolve this?
Paco
@pakoito
yeah, I don't believe we're there
multiple libraries contribute to the same package