Skip to content

0.5.0

Latest
Compare
Choose a tag to compare
@ustitc ustitc released this 28 May 11:15
· 2 commits to main since this release

Add instance creation helper

Introducing Refinery 🏭 a helper class for creating instances of types:

@JvmInline
value class Name private constructor(private val value: String) {

    companion object : Refinery<String, Name>() {
        override fun Refinement<String>.refine() = filter { it.isNotBlank() }.map { Name(it) }
    }
}

val grog = Name.fromOrThrow("Grog") // returns a Name instance "Grog"
val void = Name.fromOrThrow("")     // throws RefinementException

Add Arrow support

A new module krefty-arrow was created to support working with Either type

Deprecate Predicate

Removing Predicate support in favour of (T) -> Boolean

Remove Refined 🛑

Refined was completely replaced by Refinement