Igor Kolomiets
05/21/2022, 4:24 PMfun <T> List<T>.headAndTail() = Pair(first(), drop(1))
Does Kotlin offer more idiomatic approach to do this?Chris Lee
05/21/2022, 4:44 PMfun <T> List<T>.headAndTail() = Pair(first(), last())
Igor Kolomiets
05/21/2022, 4:48 PMtail
must be the remainder of the list.Chris Lee
05/21/2022, 4:49 PMRob Elliot
05/21/2022, 5:00 PMRob Elliot
05/21/2022, 5:01 PMChris Lee
05/21/2022, 5:01 PMIgor Kolomiets
05/21/2022, 5:09 PMChris Lee
05/21/2022, 5:09 PMIgor Kolomiets
05/21/2022, 5:13 PMephemient
05/21/2022, 6:16 PM