Sergei Zubov
08/19/2021, 6:01 PMparTraverseEither
return NonEmptyList
when called on NonEmptyList
receiver?rcd27
08/20/2021, 12:38 PMJetBrains
, check this out: they have Arrow
option in it! YEAH! (https://surveys.jetbrains.com/s3/kt-ktor-annual-customer-survey-2021)Stefan
08/20/2021, 2:13 PMgenerator-scripts/tuple.generator.kts
run in the arrow build? I'd like to add mapN to nullable tuplesGavin Ray
08/22/2021, 8:07 PMarrow-meta
called as-var-invariants
It seems to add some commits around pre
, post
and invariant
functions.
Is this going to enable a DSL for a sort of Design-by-Contract style programming similar to Ada and D, where you can state pre/post-conditions of a method and invariants of a method or class?
If so, very exciting!
• https://github.com/arrow-kt/arrow-meta/commit/38f6850bbeab3e2df7fffbd1409d0415c57a0006#diff-0cba0892a09ca12cf39e0816[…]8d75d7633e5d6fce55dd30fbfc15e
• https://github.com/arrow-kt/arrow-meta/commit/64efe5e7fed1c98dfd9460c79ec02f0eb6477708#diff-d8893c41325132d95cc89c5a[…]6dd9ea55a0c7fc4413d35bfb1d0ebFrancesco Cervone
08/25/2021, 3:26 PMValidatedNel<E, A>.zip
for validation.
Unfortunately, zip
accepts at most 9 arguments. Do you have any suggestions about using Validated
with more than 9 arguments in an “nice” way?
validatedArg0.zip(
validatedArg1,
validatedArg2,
validatedArg3,
validatedArg4,
validatedArg5,
validatedArg6,
validatedArg7,
validatedArg8,
validatedArg9,
::someFunction
)
Gavin Ray
08/28/2021, 4:48 PMOption<T>
and Kotlin's Result<T>
(which I know Kotlin devs have said not to use directly, though not entirely sure why)
And similarly for things like .runCatching { }
Has anyone transitioned from using the basic FP primitives available in Kotlin stdlib to using mostly/exclusively Arrow, and could share thoughts/opinions and experiences? Would be grateful 🙏
Thank you!Alex
08/31/2021, 10:38 AMmitch
08/31/2021, 12:00 PMNullable.zip
but it doesn’t have the extension function public inline fun <A, B, Z> A?.zip(b: B?, fn: (A, B) -> Z): Z?
i’m quite sure arrow devs have a good reason behind this..?mitch
08/31/2021, 12:08 PMeitherA.zip(eitherB, ::fn)
Is an alternate syntax like below also planned to be supported?
Either.zip(eitherA, eitherB, ::fn)
for instance, in reactor you have both Mono.zip(monoA, monoB, ::fn)
and mono.zip(other, ::fn)
mitch
08/31/2021, 12:25 PMaddamsson
08/31/2021, 6:54 PMaddamsson
08/31/2021, 6:54 PMio.arrow-kt:arrow-core:0.13.2
but I don't see the multiplatform modulesZyle Moore
09/02/2021, 2:26 AMMichael Kaiser
09/02/2021, 11:12 AMerror: @optics annotated class com.example.Player needs to declare companion object.
In my build.gradle I added the following dependencies:
implementation("io.arrow-kt:arrow-optics:0.13.2")
kapt("io.arrow-kt:arrow-meta:0.13.2")
Am I doing something wrong or is this just missing in the example code snippet?
In this question https://stackoverflow.com/questions/58243913/arrowkt-optics-annotation-not-generating-code they use arrow 0.10.0 and here it is still required and it looks to me, that back then it was still in the documentaion. So I would guess, that the companion object isn't required anymore in 0.13.2. Or am I wrong?Zyle Moore
09/03/2021, 5:16 AMzpearce
09/04/2021, 5:32 PMdimsuz
09/07/2021, 2:23 PMRandall Perry
09/07/2021, 3:56 PMval ns2: State<RNG, List<Int>> =
State.fx(Id.monad()) {
val x: Int = int.bind()
val y: Int = int.bind()
val xs: List<Int> = ints(x).bind()
xs.map { it % y }
}
Using latest Arrow libs, the above snippet fails syntax checker in Idea. ‘Id’ is not recognized, and Arrow docs say it was slated for deprecation.
Wondering if anyone can help refactor this to current Arrow version, or recommend previous version this will work with?
Asked on Manning forum, but got no reply.mitch
09/11/2021, 2:13 AMdata class ExecutionPlan<out A>(val runPlan: suspend (PlanConfig) -> A) {
fun <B> flatMap(fn: (A) -> ExecutionPlan<B>): ExecutionPlan<B> = ...
// map, zip, traverse
// etc...
}
Prior to arrow 0.13 it was leveraging ExecutionPlan.monad().fx { … }.fix()
Now that is not available anymore and I’ve refactored the code to nested flatMaps.. which proliferated in the codebase, and is causing some pain..
// what we have now:
val plan = planA.flatMap { a ->
planB.flatMap { b ->
planC(a, b).flatMap { c ->
// ...
}
}
}
// what we want:
val plan = executionPlan {
val a = planA.bind()
val b = planB.bind()
val c = planC(a, b).bind()
c
}
I’m wondering how i might leverage delimited continuation to implement this?
fun interface ExecutionPlanEffect<E, A> : Effect<ExecutionPlan<A>> {
suspend fun <B> ExecutionPlan<B>.bind(): B = ???
}
thanks!!Robert Menke
09/11/2021, 6:25 PMbind
is not defined. I’m currently using core, optics, and meta (via kapt). What am I doing wrong?Jeff
09/15/2021, 6:17 AMval someIterable : List<Validated<MyError, String>> // from a map or something similar
someIterable.zip(Semigroup.nonEmptyList<MyError>()} {array -> ... }
//or
Validated.zip(someIterable, se) {array -> ... }
I’m borrowing Rx’s api for zips / FuncN for f.
Is this a JVM optimization? (I’ve seen Clojure do similar overloading instead of a single vararg form)Ville Peurala
09/15/2021, 11:17 AMApplicative
in the latest release? Or what should I use instead?Lidonis Calhau
09/17/2021, 9:38 AMivanmorgillo
09/19/2021, 10:55 AMMarc
09/20/2021, 6:41 AMMarc
09/20/2021, 6:58 AMstojan
09/20/2021, 1:08 PMjean
09/21/2021, 7:19 AMCould not find io.arrow-kt:arrow-core-iosx64:unspecified
than_
09/21/2021, 10:56 AMthan_
09/21/2021, 10:56 AMsimon.vergauwen
09/21/2021, 11:00 AMkapt
since Arrow Meta has not been released yet. It follows an independent cycle but should become available this year too.
I’m not sure if it’s possible yet to consume the Optics plugin from Arrow Meta, it does the same thing as kapt
but MPP.
cc\\ @raulrajaraulraja
09/21/2021, 11:03 AMthan_
09/21/2021, 11:53 AMCody Mikol
09/21/2021, 2:24 PM