https://kotlinlang.org logo
#functional
Title
# functional
r

Rruiz

01/23/2019, 4:42 PM
Any ideas?
s

Shawn

01/23/2019, 4:46 PM
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

Rruiz

01/23/2019, 4:52 PM
the syntax was just to ilustrate the idea, thanks for the info!!
👍 1
r

raulraja

01/23/2019, 5:14 PM
@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

Rruiz

01/24/2019, 2:51 PM
thanks Raul, I'll give it a try!
👍 1
r

raulraja

01/24/2019, 2:57 PM
@Rruiz sounds good, if you run into any issues we are here to help.
2 Views