Robert Menke
07/20/2019, 4:05 PMR?
to Either<L, R>
? Something like
fun <L, R> R?.toEither(f: () -> L): Either<L, R> {
return Option
.fromNullable(this)
.toEither(f)
}
pakoito
07/20/2019, 10:42 PMIO.fx
rcd27
07/21/2019, 9:38 AMarrow
, but have Building with a JRE or JDK9 is currently not supported.
. Which one do I need? 11?kitttn
07/21/2019, 10:42 AMrcd27
07/21/2019, 5:00 PMrcd27
07/21/2019, 5:58 PMa
solve the compile-time problem:
binding {
val (a) = IO.invoke { 1 }
a + 1
}.fix().unsafeRunSync()
// 2
jacob
07/21/2019, 11:35 PMhttps://www.youtube.com/watch?v=aTUa_qlmoh8▾
carbaj0
07/22/2019, 7:49 AMsimon.vergauwen
07/22/2019, 8:33 AMthan_
07/22/2019, 11:55 AMval fx: Fx<ForIO> = IO.fx()
? from docs it should be import arrow.effects.extensions.io.fx.fx
but arrow.effects.extensions.io.fx
doesn't seem to exist. I'm using 0.9.1-SNAPSHOTpakoito
07/22/2019, 9:39 PMrcd27
07/24/2019, 5:52 AMpakoito
07/24/2019, 10:40 AMBob Glamm
07/24/2019, 5:23 PMpakoito
07/24/2019, 5:40 PMBob Glamm
07/24/2019, 6:27 PMIO {...}
in conjunction with effect {...}
but ^^ the example above gets to SOE pretty quickly when attempting to use the two togetherBob Glamm
07/24/2019, 6:38 PMtailrec suspend fun factorial(n) = if(n == 1) { 1 } else { n * factorial(n - 1) }
simon.vergauwen
07/24/2019, 6:52 PMkitttn
07/25/2019, 8:43 AMsuspend
plays with IO and FP.
Did you write any papers about it already? I can see it as a contribution to the sciencepakoito
07/25/2019, 9:03 AMpakoito
07/25/2019, 2:23 PMMiguel Coleto
07/25/2019, 2:53 PMstreetsofboston
07/25/2019, 3:03 PMImran/Malic
07/28/2019, 11:19 AMimport arrow.core.Id
import arrow.core.ListK
import arrow.core.Option
import arrow.core.extensions.id.applicative.applicative
import arrow.core.extensions.list.traverse.traverse
import arrow.mtl.Reader
import arrow.mtl.extensions.kleisli.applicative.applicative
interface Context
interface Topic
interface Result
typealias Job<A> = Reader<Context, A>
fun processTopic(t: Topic): Job<Result> = TODO()
fun processTopics(topics: ListK<Topic>) = // The compiler bails here
topics.traverse(Job.applicative(Id.applicative())) {
processTopic(it)
}
Can someone help me out?pakoito
07/28/2019, 1:35 PMliminal
07/28/2019, 10:28 PMcarbaj0
07/29/2019, 6:05 AMpakoito
07/29/2019, 8:33 AMTim Fennis
07/29/2019, 8:56 AMfoldRight
on Either
make use of an Eval<C>
?than_
07/29/2019, 9:41 AMthan_
07/29/2019, 9:41 AMpakoito
07/29/2019, 10:26 AMthan_
07/29/2019, 10:56 AMpakoito
07/29/2019, 11:06 AMthan_
07/29/2019, 5:08 PM