-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish arrow-validation to maven #914
Comments
That was an oversight, on the other hand the library is so underused that this is the first time someone has noticed lol We'll fix it for next release. My suggestion regardless is to migrate over to the https://arrow-kt.io/docs/datatypes/validated/ |
Thank you for the pointers! I looked into the links, and once I wrapped my head around semigroups, I think I got it. So, if I understood it correclty
Or, in as small Kotlin file I could muster (adapts the video's example here): package foobar
import arrow.data.*
import org.junit.jupiter.api.Test
import java.util.*
typealias KnownErrors = NonEmptyList<ValidatedTest.KnownError>
class ValidatedTest {
object KnownError
data class Person(val id: UUID, val name: String, val year: Int)
fun <T> validatedData(t: T? = null) = t
?.let { Valid(t) }
?: Invalid(NonEmptyList.just(KnownError))
fun printData(
label: String,
vId: Validated<KnownErrors, UUID>,
vName: Validated<KnownErrors, String>,
vAge: Validated<KnownErrors, Int>) {
Validated
.applicative(NonEmptyList.semigroup<KnownError>())
.map(vId, vName, vAge) { (id, name, age) ->
Person(id, name, age)
}
.fix()
.fold({
println("$label Errors: $it")
}, {
println("$label Valid: $it")
})
}
@Test
fun test() {
printData(
"allValid",
validatedData(UUID.randomUUID()),
validatedData("William"),
validatedData(1926)
)
printData(
"someValid",
validatedData(null),
validatedData(null),
validatedData(1926)
)
}
}
I think I understand this now. At least enough to carry the migration work. Thanks again! Should this issue be closed, or do you wish to retain it to track the inclusion of |
I'll keep the issue open, if you don't mind me changing the title to be more task-oriented. |
I don't mind at all! Thanks again 👍 |
arrow/modules/core/arrow-validation/build.gradle
Line 14 in 884ad98
We're migrating from funktionale to arrow. I couldn't find a reference to the
arrow-validation
module in issues or pull requests. It seems that its maven artifact isn't being deployed along the rest, as it is missing the following gradle apply (found in other modules):As there is no mention of this module in the readme, I'm guessing this is intentional. Maybe it's not ready for prime time, or maybe we should find a replacement in other modules. Any feedback is appreciated, we'll continue reading the docs 😄
The text was updated successfully, but these errors were encountered: