unsnoc

fun <A> List<A>.unsnoc(): Pair<List<A>, A>?(source)