Hi all! I have a question about refined types plug...
# arrow-meta
b
Hi all! I have a question about refined types plugin, are collections with primitive types acceptable in its compile time resolution? I'm trying to validade a simple predicate with a list:
Copy code
val list = listOf(1)

data class FilledList private constructor(val value: List<Int>) {
    companion object : Refined<List<Int>, FilledList>(::FilledList, { ensure((it.isNotEmpty()) to "list cannot be empty") })
}

val filledList = FilledList(list)
And is popping:
Copy code
val list = listOf(1) can't be verified at compile time. Use `Predicate.orNull(val list = listOf(1))` for safe access or `Predicate.require(val list = listOf(1))` for explicit unsafe instantiation
If I remove this list reference from the property and put its instance directly on FilledList invoke call site (
FilledList(listOf())
), nothing happens and its refinement occurs in runtime. I'm missing something or is not supported? If is not supported is there a typeclass / applicative or something that I can integrate with collections to make it work?
r
Hi Bloder, we are no longer maintaining that encoding for refinements. The new effort that is about to be released soon is https://arrow-kt.io/docs/meta/analysis/ (snapshots available)
It has more advanced checks and laws for collections
b
Hey Raul my friend! Didn't know about analysis, looks awesome! U thinking to release the stable version with FIR or we will have a version before that?
r
we will have a version before FIR and then we will adapt to FIR once stable. 🙂
you have most of the awesomeness to thank @Alejandro Serrano Mena for the great ideas and background in this space 🙏.
It’s great to see you around here @bloder !
♥️ 1
b
Nice! And yes, I'm seeing @Alejandro Serrano Mena is doing great things in Kotlin, thanks and congratulations!
@raulraja I'm trying to import analysis in my project, the classpath worked but when I declare the apply plugin I'm getting
Copy code
A problem occurred evaluating project ':app'.
> org/gradle/util/internal/VersionNumber
Did u already face that problem?
are there gradle / kotlin specific versions that I need to use with? Using kotlin 1.6.10 and getting
Copy code
Unable to load class 'org.gradle.util.internal.VersionNumber'.
(trying to use in an Android project)
r
I’m not positive but I believe you may need a newer version of gradle
b
Yeah to register for future maybe problems using gradle 7.2+ worked
👍 1
o
@raulraja I’m getting 404s for the links you shared above: • https://arrow-kt.io/docs/meta/analysis/https://arrow-kt.io/docs/meta/analysis/control/ Is this expected?
r
Hi @Olivier Laforest, It’s not, it seems as if each time the arrow site gets deployed it’s not remembering the arrow meta page locations. I believe Paco did something earlier today to fix it but seems like its back //cc @paco @simon.vergauwen
👍 1