notEmptyListOf

@SinceKotoolsTypes(version = "4.0")
fun <E> notEmptyListOf(head: E, vararg tail: E): NotEmptyList<E>

Creates a NotEmptyList starting with a head and containing all the elements of the optional tail.

Here's a simple usage example:

val integers: NotEmptyList<Int> = notEmptyListOf(1, 2, 3)
println(integers) // [1, 2, 3]