Any ideas?
# functional
r
Any ideas?
s
It may be related to the fact that maps don’t have defined iteration orders - you should be able to call
.asIterable()
or
.asSequence()
and perform your reduction on that instead
also I think your lambda syntax might be a bit jumbled
r
the syntax was just to ilustrate the idea, thanks for the info!!
👍 1
r
@Rruiz You can fold maps with Arrow both in a left and and right associative fashion https://arrow-kt.io/docs/apidocs/arrow-extras/arrow.data/-map-k/index.html
You can use the extension to get top level access also to many more methods derived from Foldable https://arrow-kt.io/docs/apidocs/arrow-extras-extensions/arrow.data.extensions.mapk.foldable/arrow.-kind/index.html
r
thanks Raul, I'll give it a try!
👍 1
r
@Rruiz sounds good, if you run into any issues we are here to help.