Lipen / kotlin-maybe

Maybe for Kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maybe<T> for Kotlin

CI JitPack Hits-of-Code

This is a simple implementation of Maybe<T> for Kotlin. It is a simple wrapper around a nullable value, with some utility methods to work with it.

Installation

build.gradle.kts
repositories {
    maven("https://jitpack.io")
}

dependencies {
    implementation("com.github.Lipen:kotlin-maybe:$version")
}

Library usage

val x: Maybe<Int> = Maybe.some(5)
println(x) // Some(5)

val y: Maybe<Int> = Maybe.none
println(y) // None

About

Maybe for Kotlin


Languages

Language:Kotlin 100.0%