Skip to content

Instantly share code, notes, and snippets.

View cesards's full-sized avatar
👀
Always watching for new awesome repos.

César Díez Sánchez cesards

👀
Always watching for new awesome repos.
View GitHub Profile
@raulraja
raulraja / TwitterHandle.kt
Created February 20, 2020 12:16
Type Refinements with Type Proofs in Kotlin
/* Coming up ~ April 2020 */
package test
import arrow.*
inline class TwitterHandle(val handle: String) {
companion object : Refined<String> {
override val validate: String.() -> Map<String, Boolean> = {
mapOf(
"Should start with '@'" to startsWith("@"),