Package-level declarations

Types

Link copied to clipboard
sealed class AnsiColor
Link copied to clipboard
open class DirScope(file: File) : FileScope
Link copied to clipboard
sealed class Either<out A, out B>
Link copied to clipboard
typealias EitherNel<E, A> = Either<List<E>, A>
Link copied to clipboard
open class FileScope(file: File) : File
Link copied to clipboard
annotation class FileScopeMarker

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
inline fun String.ansiColor(color: AnsiColor): String
Link copied to clipboard
inline fun String.capitalize(): String

Returns a copy of this string having its first letter title-cased using the rules of the default locale, or the original string if it's empty or already starts with a title case letter.

Link copied to clipboard
fun <A, B> Either<A, B>.combine(other: Either<A, B>, combineLeft: (A, A) -> A, combineRight: (B, B) -> B): Either<A, B>

Combine two Either values. If both are Right then combine both B values using combineRight or if both are Left then combine both A values using combineLeft, otherwise return the sole Left value (either this or other).

Link copied to clipboard
operator fun <A : Comparable<A>, B : Comparable<B>> Either<A, B>.compareTo(other: Either<A, B>): Int
Link copied to clipboard
inline fun String.decapitalize(): String

Returns a copy of this string having its first letter lowercased using the rules of the default locale, or the original string if it's empty or already starts with a lower case letter.

Link copied to clipboard
inline fun <T> Iterable<T>.eighth(): T

Returns eighth element.

Link copied to clipboard
inline fun <T> Iterable<T>.eighthOrNull(): T?
Link copied to clipboard

Add an empty line as last item if it is not empty

Link copied to clipboard
inline fun <T> Iterable<T>.fifth(): T

Returns fifth element.

Link copied to clipboard
inline fun <T> Iterable<T>.fifthOrNull(): T?
Link copied to clipboard
inline fun <A, B, C> Either<A, B>.flatMap(f: (right: B) -> Either<A, C>): Either<A, C>

Binds the given function across Right, that is, Map, or transform, the right value B of this Either into a new Either with a right value of type C. Returns a new Either with either the original left value of type A or the newly transformed right value of type C.

Link copied to clipboard
fun <A, B> Either<A, Either<A, B>>.flatten(): Either<A, B>
Link copied to clipboard
inline fun <T> Iterable<T>.forth(): T

Returns forth element.

Link copied to clipboard
inline fun <T> Iterable<T>.forthOrNull(): T?
Link copied to clipboard
infix inline fun <A, B> Either<A, B>.getOrElse(default: (A) -> B): B

Get the right value B of this Either, or compute a default value with the left value A.

Link copied to clipboard
fun <A, B, C> Either<A, B>.handleErrorWith(f: (A) -> Either<C, B>): Either<C, B>

Binds the given function across Left, that is, Map, or transform, the left value A of this Either into a new Either with a left value of type C. Returns a new Either with either the original right value of type B or the newly transformed left value of type C.

Link copied to clipboard
inline fun <A> identity(a: A): A
Link copied to clipboard
inline fun Boolean.ifFalse(block: () -> Unit): Boolean
Link copied to clipboard
inline fun <T> T?.ifNotNull(block: () -> Unit): T?
Link copied to clipboard
inline fun <T> T?.ifNull(block: () -> Unit): T?
Link copied to clipboard
inline fun Boolean.ifTrue(block: () -> Unit): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <A> A.left(): Either<A, Nothing>
Link copied to clipboard
Link copied to clipboard
fun <A> Either<A, A>.merge(): A

Returns the value from this Right or Left.

Link copied to clipboard
inline fun <T> Iterable<T>.ninth(): T

Returns ninth element.

Link copied to clipboard
inline fun <T> Iterable<T>.ninthOrNull(): T?
Link copied to clipboard
inline fun CharSequence.notContain(regex: Regex): Boolean
inline fun CharSequence.notContain(other: CharSequence, ignoreCase: Boolean = false): Boolean
Link copied to clipboard
infix inline fun <T> T?.or(other: T): T
infix inline fun <T> T?.or(block: () -> T): T
Link copied to clipboard
inline fun <T> Iterable<T>.penultimate(): T

Returns penultimate element.

Link copied to clipboard
inline fun <T> Iterable<T>.penultimateOrNull(): T?
Link copied to clipboard
fun String.remove(vararg values: String, ignoreCase: Boolean = false): String

inline fun String.remove(value: String, ignoreCase: Boolean = false): String

Returns a new string obtained by removing all occurrences of the value substring in this string

Link copied to clipboard

Remove all consecutive line breaks in a String

Remove all consecutive line breaks in a list of String

Link copied to clipboard
fun String.removeIf(value: String, ignoreCase: Boolean = false, block: (String) -> Boolean): String
Link copied to clipboard
fun String.replace(vararg oldToNewValues: Pair<String, String>): String
Link copied to clipboard
fun resource(name: String): File
Link copied to clipboard
Link copied to clipboard
fun <A> A.right(): Either<Nothing, A>
Link copied to clipboard
fun File.root(name: String, block: DirScope.() -> Unit = {}): DirScope
Link copied to clipboard
inline fun <T> Iterable<T>.second(): T

Returns second element.

Link copied to clipboard
inline fun <T> Iterable<T>.secondOrNull(): T?
Link copied to clipboard
inline fun <T> Iterable<T>.seventh(): T

Returns seventh element.

Link copied to clipboard
inline fun <T> Iterable<T>.seventhOrNull(): T?
Link copied to clipboard
inline fun <T> Iterable<T>.sixth(): T

Returns sixth element.

Link copied to clipboard
inline fun <T> Iterable<T>.sixthOrNull(): T?
Link copied to clipboard
inline fun <T> Iterable<T>.tenth(): T

Returns tenth element.

Link copied to clipboard
inline fun <T> Iterable<T>.tenthOrNull(): T?
Link copied to clipboard
inline fun <T> Iterable<T>.third(): T

Returns third element.

Link copied to clipboard
inline fun <T> Iterable<T>.thirdOrNull(): T?
Link copied to clipboard
fun <E, A> Either<E, A>.toEitherNel(): EitherNel<E, A>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard