Neil Miller
09/20/2022, 3:24 AMsimon.vergauwen
09/20/2022, 6:48 AMsimon.vergauwen
09/20/2022, 6:49 AMStylianos Gakis
09/20/2022, 7:37 AMList
doesnāt give so I get to use it lately.simon.vergauwen
09/20/2022, 7:42 AMList
. And all operations are build around it, so it easily becomes a toXXX
conversion fest all over the codebase š
On the flip-side, it offers us seamless inter-op with Java..
Of course it heavily depends on the case. For performance reasons in Compose it makes a lot of sense, but you could potentially just to toImmutableList
at the edge where you put it into Compose
, right?simon.vergauwen
09/20/2022, 7:43 AMStylianos Gakis
09/20/2022, 7:54 AMtoPersistentList()
after I was done making some maps etc on it. And yes it worked to turn it into a persistent one at the edge just for compose, which is what I did in the little Iāve played with it.
Would it help if all the collection operators were copied to persist the ImmutableCollection
type? Or if not how would you envision a proper version of this? Never tried Scala so canāt relate with that unfortunatelyraulraja
09/20/2022, 8:41 AMStylianos Gakis
09/20/2022, 8:48 AMsimon.vergauwen
09/20/2022, 8:49 AMsimon.vergauwen
09/20/2022, 8:51 AMIf this is the case, why would the kotlinx not be considered a library with a good API?I would say that the API itself is fine, it might be a bit unconventional for people used to immutable collections though. Especially the
mutate
builder š but it's very much in the Kotlin spirit so I think it's probably a good thing. Accepting the current status-quo is not better for sure.
A solution such as the KEEP that could potentially reduce, or completely eliminate the need for many conversions would be great though.raulraja
09/20/2022, 9:01 AMCould something like Scala's match types improve the return type issue?yes if Kotlin had a form of transparent
inline
you could hide the implementations, but it's probably overkill.
Also it could be hidden with automatic implicit conversions.
Beside the ergonomics this would not be a great solution either.
The real problem is the community already depends on the collections in the std lib.
It's the same as if the std lib included Either
, it would not make sense for Arrow to include it even if our Either was more complete. We'd choose to try to make better whatever is already in the std lib and in use by the rest of the community.Satyam Agarwal
09/20/2022, 1:50 PMFirst thing that immediately felt "off" for me, compared to i.e. Scala was that Kotlin seems to favor the read-onlySame applies to NonEmptyList in arrow. I love this data type but it's so tedious to convert it back and forth.. And all operations are build around it, so it easily becomes aList
conversion fest all over the codebase štoXXX
Neil Miller
09/21/2022, 5:20 PMStylianos Gakis
09/21/2022, 10:01 PMNeil Miller
09/22/2022, 12:42 AM