notEmptySetOf

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

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

Here's a simple usage example:

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